mirror of
https://github.com/fradelg/docker-mysql-cron-backup.git
synced 2025-01-18 16:22:33 +01:00
Using dockerize as entry point
This commit is contained in:
parent
4c71297f03
commit
fe1028a205
1 changed files with 7 additions and 2 deletions
|
@ -3,13 +3,18 @@ LABEL maintainer "Fco. Javier Delgado del Hoyo <frandelhoyo@gmail.com>"
|
||||||
|
|
||||||
COPY ["run.sh", "backup.sh", "restore.sh", "/"]
|
COPY ["run.sh", "backup.sh", "restore.sh", "/"]
|
||||||
|
|
||||||
RUN apk add --update bash mysql-client gzip && rm -rf /var/cache/apk/* && mkdir /backup &&\
|
RUN apk add --update bash mysql-client gzip openssl && rm -rf /var/cache/apk/* && mkdir /backup &&\
|
||||||
chmod u+x /backup.sh /restore.sh
|
chmod u+x /backup.sh /restore.sh
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
ENV CRON_TIME="0 3 * * sun" \
|
ENV CRON_TIME="0 3 * * sun" \
|
||||||
MYSQL_HOST="mysql" \
|
MYSQL_HOST="mysql" \
|
||||||
MYSQL_PORT="3306"
|
MYSQL_PORT="3306"
|
||||||
|
|
||||||
VOLUME ["/backup"]
|
VOLUME ["/backup"]
|
||||||
|
|
||||||
CMD ["/run.sh"]
|
CMD dockerize -wait tcp://${MYSQL_HOST}:3306 /run.sh
|
||||||
|
|
Loading…
Reference in a new issue