Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ jobs:
build_and_push:
runs-on: ubuntu-latest

strategy:
matrix:
include:
- mariadb-version: 10.7

steps:
- name: "Checkout Sourcecode"
uses: actions/checkout@v2
Expand All @@ -39,17 +34,14 @@ jobs:
"${{ runner.os }}-buildx-${{ matrix.mariadb-version }}-"
"${{ runner.os }}-buildx-"

- name: "Docker build mariadb-${{ matrix.mariadb-version }}"
run: make build MARIADB_VERSION=${{ matrix.mariadb-version }}

- name: "Login to DockerHub"
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: "Docker push mariadb-${{ matrix.mariadb-version }}"
run: make build BUILDX_OPTIONS=--push MARIADB_VERSION=${{ matrix.mariadb-version }}
- name: "Docker build and push"
run: make build BUILDX_OPTIONS=--push

- name: "Update Docker Hub Description (croneu/phpapp-db)"
uses: peter-evans/dockerhub-description@v2
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions Dockerfile.mysql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://hub.docker.com/_/mysql/

ARG MYSQL_VERSION=8.0

FROM mysql:${MYSQL_VERSION}

ADD mysql.cnf /etc/mysql/conf.d/z99-docker.cnf
RUN chown mysql:mysql /etc/mysql/conf.d/z99-docker.cnf \
&& chmod 0644 /etc/mysql/conf.d/z99-docker.cnf
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ PLATFORMS=linux/arm64/v8,linux/amd64

# Defaults:
MARIADB_VERSION=10.7
MYSQL_VERSION=8.0

#BUILDX_OPTIONS=--push
DOCKER_CACHE=--cache-from "type=local,src=.buildx-cache" --cache-to "type=local,dest=.buildx-cache"

build:
docker buildx build $(DOCKER_CACHE) $(BUILDX_OPTIONS) \
--platform $(PLATFORMS) \
-f Dockerfile.mariadb \
--build-arg MARIADB_VERSION=$(MARIADB_VERSION) --tag croneu/phpapp-db:mariadb-$(MARIADB_VERSION) .
docker buildx build $(DOCKER_CACHE) $(BUILDX_OPTIONS) \
--platform $(PLATFORMS) \
-f Dockerfile.mysql \
--build-arg MYSQL_VERSION=$(MYSQL_VERSION) --tag croneu/phpapp-db:mysql-$(MYSQL_VERSION) .
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ This is the MySQL database container, with images for **amd64** and **arm64**
## Tags available

* `croneu/phpapp-db:mariadb-10.7`
* `croneu/phpapp-db:mysql-8.0`

This is just a pre-configured alternative to the upstream official **MariaDB** image. This
allows us to use it straight on for TYPO3 projects without having to include any further
This is just a pre-configured alternative to the upstream official images (**MariaDB** or **MySQL**).
This allows us to use it straight on for TYPO3 projects without having to include any further
configuration or do any performance tuning.

We are using MariaDB instead of the official MySQL images, because these are not available
for ARM architecture yet.

## Settings

See upstream: https://hub.docker.com/_/mariadb
See upstream:
* https://hub.docker.com/_/mariadb
* https://hub.docker.com/_/mysql

Example `docker-compose.yaml`:
Example `docker-compose.yaml` for MariaDB:

```
mysql:
Expand All @@ -41,6 +41,22 @@ Example `docker-compose.yaml`:
MARIADB_PASSWORD: ${DB_PASS}
```

Example `docker-compose.yaml` for MySQL 8.0:

```
mysql:
image: croneu/phpapp-db:mysql-8.0
ports:
- 13306:3306
volumes:
- mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASS}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASS}
```

----

## Docker Image Development
Expand Down
57 changes: 57 additions & 0 deletions mysql.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[mysqld]

# Defaults noted here are from MySQL 8.0 (official docker image)

#################################################
## Buffers

# default is 8M
key_buffer_size = 128M

# default is 128M
innodb_buffer_pool_size = 512M

# default is 100M
innodb_redo_log_capacity = 512M

# default is 16M
innodb_log_buffer_size = 128M

# default is 16M
tmp_table_size = 128M

# default is 16M
max_heap_table_size = 128M

# default is 256k
join_buffer_size = 4M

# default is 256k
sort_buffer_size = 4M

# default is 128k
read_buffer_size = 1M

# default is 256k
read_rnd_buffer_size = 1M

#################################################
## Misc

# default is 1
innodb_flush_log_at_trx_commit = 0

# default is fsync
innodb_flush_method = O_DSYNC

#################################################
## Connections

# default is 151
max_connections = 20

#################################################
## TYPO3 compatibility

# default is ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
sql_mode = ""