Skip to content

Commit e15812c

Browse files
authored
Merge pull request #1 from cron-eu/mysql-8.0
Add mysql-8.0
2 parents 480f41a + c152ba2 commit e15812c

File tree

6 files changed

+97
-17
lines changed

6 files changed

+97
-17
lines changed

.github/workflows/build-and-push.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ jobs:
1010
build_and_push:
1111
runs-on: ubuntu-latest
1212

13-
strategy:
14-
matrix:
15-
include:
16-
- mariadb-version: 10.7
17-
1813
steps:
1914
- name: "Checkout Sourcecode"
2015
uses: actions/checkout@v2
@@ -39,17 +34,14 @@ jobs:
3934
"${{ runner.os }}-buildx-${{ matrix.mariadb-version }}-"
4035
"${{ runner.os }}-buildx-"
4136
42-
- name: "Docker build mariadb-${{ matrix.mariadb-version }}"
43-
run: make build MARIADB_VERSION=${{ matrix.mariadb-version }}
44-
4537
- name: "Login to DockerHub"
4638
uses: docker/login-action@v1
4739
with:
4840
username: ${{ secrets.DOCKERHUB_USERNAME }}
4941
password: ${{ secrets.DOCKERHUB_TOKEN }}
5042

51-
- name: "Docker push mariadb-${{ matrix.mariadb-version }}"
52-
run: make build BUILDX_OPTIONS=--push MARIADB_VERSION=${{ matrix.mariadb-version }}
43+
- name: "Docker build and push"
44+
run: make build BUILDX_OPTIONS=--push
5345

5446
- name: "Update Docker Hub Description (croneu/phpapp-db)"
5547
uses: peter-evans/dockerhub-description@v2
File renamed without changes.

Dockerfile.mysql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See https://hub.docker.com/_/mysql/
2+
3+
ARG MYSQL_VERSION=8.0
4+
5+
FROM mysql:${MYSQL_VERSION}
6+
7+
ADD mysql.cnf /etc/mysql/conf.d/z99-docker.cnf
8+
RUN chown mysql:mysql /etc/mysql/conf.d/z99-docker.cnf \
9+
&& chmod 0644 /etc/mysql/conf.d/z99-docker.cnf

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@ PLATFORMS=linux/arm64/v8,linux/amd64
33

44
# Defaults:
55
MARIADB_VERSION=10.7
6+
MYSQL_VERSION=8.0
67

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

1011
build:
1112
docker buildx build $(DOCKER_CACHE) $(BUILDX_OPTIONS) \
1213
--platform $(PLATFORMS) \
14+
-f Dockerfile.mariadb \
1315
--build-arg MARIADB_VERSION=$(MARIADB_VERSION) --tag croneu/phpapp-db:mariadb-$(MARIADB_VERSION) .
16+
docker buildx build $(DOCKER_CACHE) $(BUILDX_OPTIONS) \
17+
--platform $(PLATFORMS) \
18+
-f Dockerfile.mysql \
19+
--build-arg MYSQL_VERSION=$(MYSQL_VERSION) --tag croneu/phpapp-db:mysql-$(MYSQL_VERSION) .

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ This is the MySQL database container, with images for **amd64** and **arm64**
1313
## Tags available
1414

1515
* `croneu/phpapp-db:mariadb-10.7`
16+
* `croneu/phpapp-db:mysql-8.0`
1617

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

21-
We are using MariaDB instead of the official MySQL images, because these are not available
22-
for ARM architecture yet.
23-
2422
## Settings
2523

26-
See upstream: https://hub.docker.com/_/mariadb
24+
See upstream:
25+
* https://hub.docker.com/_/mariadb
26+
* https://hub.docker.com/_/mysql
2727

28-
Example `docker-compose.yaml`:
28+
Example `docker-compose.yaml` for MariaDB:
2929

3030
```
3131
mysql:
@@ -41,6 +41,22 @@ Example `docker-compose.yaml`:
4141
MARIADB_PASSWORD: ${DB_PASS}
4242
```
4343

44+
Example `docker-compose.yaml` for MySQL 8.0:
45+
46+
```
47+
mysql:
48+
image: croneu/phpapp-db:mysql-8.0
49+
ports:
50+
- 13306:3306
51+
volumes:
52+
- mysql:/var/lib/mysql
53+
environment:
54+
MYSQL_ROOT_PASSWORD: ${DB_PASS}
55+
MYSQL_DATABASE: ${DB_NAME}
56+
MYSQL_USER: ${DB_USER}
57+
MYSQL_PASSWORD: ${DB_PASS}
58+
```
59+
4460
----
4561

4662
## Docker Image Development

mysql.cnf

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[mysqld]
2+
3+
# Defaults noted here are from MySQL 8.0 (official docker image)
4+
5+
#################################################
6+
## Buffers
7+
8+
# default is 8M
9+
key_buffer_size = 128M
10+
11+
# default is 128M
12+
innodb_buffer_pool_size = 512M
13+
14+
# default is 100M
15+
innodb_redo_log_capacity = 512M
16+
17+
# default is 16M
18+
innodb_log_buffer_size = 128M
19+
20+
# default is 16M
21+
tmp_table_size = 128M
22+
23+
# default is 16M
24+
max_heap_table_size = 128M
25+
26+
# default is 256k
27+
join_buffer_size = 4M
28+
29+
# default is 256k
30+
sort_buffer_size = 4M
31+
32+
# default is 128k
33+
read_buffer_size = 1M
34+
35+
# default is 256k
36+
read_rnd_buffer_size = 1M
37+
38+
#################################################
39+
## Misc
40+
41+
# default is 1
42+
innodb_flush_log_at_trx_commit = 0
43+
44+
# default is fsync
45+
innodb_flush_method = O_DSYNC
46+
47+
#################################################
48+
## Connections
49+
50+
# default is 151
51+
max_connections = 20
52+
53+
#################################################
54+
## TYPO3 compatibility
55+
56+
# default is ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
57+
sql_mode = ""

0 commit comments

Comments
 (0)