-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
45 lines (45 loc) · 1.01 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
34
35
36
37
38
39
40
41
42
43
44
45
# syntax=docker/dockerfile:1
#
ARG IMAGEBASE=frommakefile
#
FROM ${IMAGEBASE}
#
RUN set -xe \
&& apk add --no-cache --purge -uU \
mysql \
mysql-client \
mariadb \
mariadb-backup \
mariadb-client \
mariadb-mytop \
mariadb-plugin-rocksdb \
mariadb-server-utils \
tzdata \
# remove default user alpine as it seems clash with user mysql
# e.g claims mysql socket and fail healthcheck via socket
&& userdel -rf alpine \
&& mkdir -p /defaults \
&& mv /etc/my.cnf /defaults/my.cnf.default \
&& mv /etc/my.cnf.d /defaults/my.cnf.d.default \
&& rm -rf /var/cache/apk/* /tmp/*
#
ENV \
S6_USER=mysql \
S6_USERHOME=/var/lib/mysql
#
COPY root/ /
#
VOLUME ["/var/lib/mysql", "/var/lib/mysql_backups", "/etc/my.cnf.d", "/etc/my.initdb.d"]
#
EXPOSE 3306 3366
#
HEALTHCHECK \
--interval=2m \
--retries=5 \
--start-period=5m \
--timeout=10s \
CMD \
/scripts/run.sh healthcheck \
|| exit 1
#
ENTRYPOINT ["/init"]