2018-01-30 08:32:45 +01:00
|
|
|
FROM alpine:3.7
|
2017-09-11 09:36:38 +02:00
|
|
|
LABEL maintainer "Fco. Javier Delgado del Hoyo <frandelhoyo@gmail.com>"
|
2017-03-27 21:16:15 +02:00
|
|
|
|
2018-02-12 15:43:58 +01:00
|
|
|
COPY ["run.sh", "backup.sh", "restore.sh", "/"]
|
|
|
|
|
2018-11-08 14:46:39 +01:00
|
|
|
RUN apk add --update bash mysql-client gzip openssl && rm -rf /var/cache/apk/* && mkdir /backup &&\
|
2018-02-12 15:43:58 +01:00
|
|
|
chmod u+x /backup.sh /restore.sh
|
2017-03-27 21:16:15 +02:00
|
|
|
|
2018-11-08 14:46:39 +01:00
|
|
|
ENV DOCKERIZE_VERSION v0.6.1
|
|
|
|
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
|
|
|
|
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
|
|
|
|
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
|
|
|
|
|
2017-03-27 21:16:15 +02:00
|
|
|
ENV CRON_TIME="0 3 * * sun" \
|
|
|
|
MYSQL_HOST="mysql" \
|
2018-11-09 15:55:53 +01:00
|
|
|
MYSQL_PORT="3306" \
|
|
|
|
TIMEOUT="10s"
|
2017-03-27 21:16:15 +02:00
|
|
|
|
|
|
|
VOLUME ["/backup"]
|
|
|
|
|
2018-11-09 15:55:53 +01:00
|
|
|
CMD dockerize -wait tcp://${MYSQL_HOST}:${MYSQL_PORT} -timeout ${TIMEOUT} /run.sh
|