-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
executable file
·38 lines (32 loc) · 1.42 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
FROM marshall:version AS mysql-proxy
LABEL maintainer="Matthew Baggett <[email protected]>" \
org.label-schema.vcs-url="https://github.com/benzine-framework/docker-mysql-proxy" \
org.opencontainers.image.source="https://github.com/benzine-framework/docker-mysql-proxy"
ENV MYSQL_PROXY_VERSION 0.8.5
ENV MYSQL_PROXY_TAR_NAME mysql-proxy-$MYSQL_PROXY_VERSION-linux-debian6.0-x86-64bit
ENV DEBIAN_FRONTEND=noninteractive
RUN adduser mysql && \
apt-get update && \
apt-get upgrade -y ca-certificates tzdata && \
apt-get -y install --no-install-recommends \
wget \
mysql-client \
socat \
&& \
wget -q https://downloads.mysql.com/archives/get/p/21/file/$MYSQL_PROXY_TAR_NAME.tar.gz && \
tar -xzvf $MYSQL_PROXY_TAR_NAME.tar.gz && \
mv $MYSQL_PROXY_TAR_NAME /opt/mysql-proxy && \
rm $MYSQL_PROXY_TAR_NAME.tar.gz && \
DEBIAN_FRONTEND=noninteractive apt-get -y remove wget && \
apt-get autoremove -yqq && \
apt-get clean && \
rm -rf /var/lib/apt/lists/ && \
chown -R mysql:mysql /opt/mysql-proxy
COPY main.lua /opt/mysql-proxy/conf/main.lua
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
COPY healthcheck.sh /usr/local/bin/healthcheck.sh
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/healthcheck.sh
CMD [ "/usr/local/bin/entrypoint.sh" ]
HEALTHCHECK --interval=5s --timeout=3s --start-period=5s --retries=3 \
CMD /usr/local/bin/healthcheck.sh || exit 1
USER mysql