move TIMEOUT var into Dockerfile
This commit is contained in:
parent
7ee2b2f418
commit
05ebe88f72
|
|
@ -2,6 +2,7 @@ FROM ubuntu:14.04
|
||||||
MAINTAINER Terry Chen <seterrychen@gmail.com>
|
MAINTAINER Terry Chen <seterrychen@gmail.com>
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
ENV TIMEOUT 12h
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
|
|
@ -9,6 +10,7 @@ RUN \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
VOLUME /etc/apt
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
COPY setup.sh /setup.sh
|
COPY setup.sh /setup.sh
|
||||||
CMD /bin/bash setup.sh
|
CMD ["/bin/bash", "setup.sh"]
|
||||||
|
|
|
||||||
5
setup.sh
5
setup.sh
|
|
@ -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
|
sed -i '12s/DocumentRoot \/var\/www\/html/DocumentRoot \/var\/www\/package/' /etc/apache2/sites-enabled/000-default.conf
|
||||||
service apache2 restart
|
service apache2 restart
|
||||||
|
|
||||||
UNIT=${TIMEOUT:-12h}
|
|
||||||
while true; do
|
while true; do
|
||||||
|
|
||||||
# parse mirror.list to share under /var/www/package path
|
# parse mirror.list to share under /var/www/package path
|
||||||
|
|
@ -22,7 +21,7 @@ while true; do
|
||||||
done
|
done
|
||||||
|
|
||||||
apt-mirror
|
apt-mirror
|
||||||
printf "\n\n====== wait $UNIT to execute apt-mirror again ======\n\n"
|
printf "\n\n====== wait $TIMEOUT to execute apt-mirror again ======\n\n"
|
||||||
sleep $UNIT
|
sleep $TIMEOUT
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue