-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (24 loc) · 1.24 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.1
MAINTAINER [email protected]
ENV DOCKERIZE_VERSION="0.2.0" \
GALERA_SLAVE_THREADS=1 \
MARIADB_DEFAULT_STORAGE_ENGINE=InnoDB \
MARIADB_MAX_ALLOWED_PACKET=32M
RUN apt-get update && apt-get install wget -y && \
wget -O - https://github.com/jwilder/dockerize/releases/download/v${DOCKERIZE_VERSION}/dockerize-linux-amd64-v${DOCKERIZE_VERSION}.tar.gz | tar -xzf - -C /usr/local/bin && \
apt-get remove wget --purge -y && apt-get autoremove --purge -y &&\
# Prepare configuration folder for MariaDB
mkdir -p /etc/mysql/conf.d /usr/share/zoneinfo /run/mysqld /data && \
chown -R mysql:mysql /etc/mysql/conf.d /run/mysqld /var/lib/mysql /data && \
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime
chmod 777 /run/mysqld
# Dynamic configuration script (will be compiled with env vars on boot)
ADD ./conf/mysql_server.cnf /mysql_server.cnf
ADD ./run.sh /run.sh
ENV MARIADB_INNODB_BUFFER_POOL_SIZE=134217728 \
MARIADB_INNODB_BUFFER_POOL_INSTANCES=1
# Exposed galera cluster ports + MariaDB port
EXPOSE 4567 4568 4444 3306
VOLUME ["/data"]
USER mysql
CMD dockerize -template /mysql_server.cnf:/etc/mysql/conf.d/mysql_server.cnf && /run.sh