forked from toughIQ/docker-mariadb-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (26 loc) · 1.02 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM mariadb:10.5
MAINTAINER [email protected]
RUN apt-get update && apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/*
COPY ["scripts/", "/docker-entrypoint-initdb.d/"]
COPY ["bin/preflight.sh", "/usr/local/bin/"]
RUN chmod 755 /usr/local/bin/preflight.sh; \
sed -i '/exec "$@"/i /usr/local/bin/preflight.sh' /usr/local/bin/docker-entrypoint.sh
# we need to touch and chown config files, since we cant write as mysql user
RUN touch /etc/mysql/conf.d/galera.cnf \
&& chown mysql.mysql /etc/mysql/conf.d/galera.cnf \
&& chown mysql.mysql /docker-entrypoint-initdb.d/*.sql
# we expose all Cluster related Ports
# 3306: default MySQL/MariaDB listening port
# 4444: for State Snapshot Transfers
# 4567: Galera Cluster Replication
# 4568: Incremental State Transfer
EXPOSE 3306 4444 4567 4568
# we set some defaults
ENV GALERA_USER=galera \
GALERA_PASS=galerapass \
MAXSCALE_USER=maxscale \
MAXSCALE_PASS=maxscalepass \
CLUSTER_NAME=docker_cluster \
MYSQL_ALLOW_EMPTY_PASSWORD=1
CMD ["mysqld"]