-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
30 lines (21 loc) · 1.25 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
ARG UPSTREAM_IMAGE
FROM ${UPSTREAM_IMAGE}
# Has to be set again after FROM
ARG VERSION
# Docksal settings
COPY ./${VERSION}/default.cnf /etc/mysql/conf.d/10-default.cnf
VOLUME /var/lib/mysql
COPY docker-entrypoint.d /docker-entrypoint.d
COPY healthcheck.sh /opt/healthcheck.sh
COPY docker-preinit-entrypoint.patch /usr/local/bin/docker-preinit-entrypoint.patch
COPY docker-postinit-entrypoint.patch /usr/local/bin/docker-postinit-entrypoint.patch
# Apply patch for running scripts placed in /docker-entrypoint.d/* by root
RUN set -xe; \
sed -i -e '/\$(id -u)/r /usr/local/bin/docker-preinit-entrypoint.patch' /usr/local/bin/docker-entrypoint.sh; \
sed -n -i -e '/ls \/docker-entrypoint-initdb.d\/ > \/dev\/null/ r /usr/local/bin/docker-postinit-entrypoint.patch' -e 1x -e '2,${x;p}' -e '${x;p}' /usr/local/bin/docker-entrypoint.sh; \
rm -f /usr/local/bin/docker-preinit-entrypoint.patch /usr/local/bin/docker-postinit-entrypoint.patch
EXPOSE 3306
# Starting with mariadb 10.5, character-set-server and collation-server can only be set via command line arguments.
CMD ["mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci"]
# Health check script
HEALTHCHECK --interval=5s --timeout=1s --retries=12 CMD ["/opt/healthcheck.sh"]