move TIMEOUT var into Dockerfile

This commit is contained in:
Terry Chen 2015-08-17 17:37:27 +08:00
parent 7ee2b2f418
commit 05ebe88f72
2 changed files with 5 additions and 4 deletions

View File

@ -2,6 +2,7 @@ FROM ubuntu:14.04
MAINTAINER Terry Chen <seterrychen@gmail.com>
ENV DEBIAN_FRONTEND noninteractive
ENV TIMEOUT 12h
RUN \
apt-get update && \
@ -9,6 +10,7 @@ RUN \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
VOLUME /etc/apt
EXPOSE 80
COPY setup.sh /setup.sh
CMD /bin/bash setup.sh
CMD ["/bin/bash", "setup.sh"]

View File

@ -5,7 +5,6 @@ mkdir /var/www/package
sed -i '12s/DocumentRoot \/var\/www\/html/DocumentRoot \/var\/www\/package/' /etc/apache2/sites-enabled/000-default.conf
service apache2 restart
UNIT=${TIMEOUT:-12h}
while true; do
# parse mirror.list to share under /var/www/package path
@ -22,7 +21,7 @@ while true; do
done
apt-mirror
printf "\n\n====== wait $UNIT to execute apt-mirror again ======\n\n"
sleep $UNIT
printf "\n\n====== wait $TIMEOUT to execute apt-mirror again ======\n\n"
sleep $TIMEOUT
done