A
A
Andrew Vityuk2016-08-31 13:50:33
Backup
Andrew Vityuk, 2016-08-31 13:50:33

How to set Environment in Dockerfile?

Hello. I ran into such a problem, I used to sit on vps and there it was configured to upload backups to the mega cloud. To create backups, I use tutum / mysql-backup, but there is already a problem with uploading. I created a container with mega, but I don’t understand how to connect cron, and so that at a certain time (preferably through Environment, otherwise there will be several containers), the script is launched. Here is the Dockerfile

FROM debian:latest
RUN echo "deb http.us.debian.org/debian unstable main non-free contrib" >> /etc/apt/sources.list
RUN echo "deb-src http.us.debian.org/debian unstable main non-free contrib" >> /etc/apt/sources.list
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && \
apt-get install -y \
megatools \
wget \
curl && \
apt-get autoremove && \
apt-get autoclean && \
apt-get clean && \
apt-get purge && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
VOLUME /backups

script
megacopy --local /backups --remote /Root/$REMOTEPATH -u $USERNAME -p $PASSWORD"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tyranron, 2016-08-31
@z_i_z_u

Throw megacopythe command into the cron's task book and start crondthe container's main process (to run in the foreground).
Here is an example under alpine .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question