2019-01-25 03:12:31 +00:00
|
|
|
FROM phusion/baseimage:0.11
|
2016-04-08 20:41:48 +00:00
|
|
|
|
|
|
|
VOLUME /var/mirror
|
|
|
|
|
2020-02-15 18:29:22 +00:00
|
|
|
ENV MIRROR_UPDATE_INTERVAL_SECONDS 43200
|
|
|
|
ENV UBUNTU_MIRROR_ARCHITECTURES amd64
|
|
|
|
# set to anything but 'false' to mirror source code as well
|
|
|
|
ENV UBUNTU_ENABLE_SOURCE_MIRRORING false
|
|
|
|
ENV UBUNTU_MIRROR_CATEGORIES main,universe,restricted,multiverse
|
|
|
|
ENV UBUNTU_MIRROR_UPSTREAM archive.ubuntu.com
|
2020-02-15 17:44:17 +00:00
|
|
|
ENV UBUNTU_MIRROR_PROJECTS bionic,bionic-updates,bionic-security,bionic-backports,focal,focal-updates,focal-security,focal-backports
|
|
|
|
|
2020-02-15 17:55:25 +00:00
|
|
|
# The following is the URL populated in /mirrors.txt as used by mirror://
|
|
|
|
# protocol scheme in sources.list
|
|
|
|
# the idea is that you can DNS rewrite 'mirrors.ubuntu.com' to this mirror
|
|
|
|
# and it will return a "list" of mirrors that includes only itself.
|
|
|
|
# then you can safely use something like the following in your sources.list
|
|
|
|
# and it will work with max speed on your own dns-rewritten lan and in the
|
|
|
|
# unmodified datacenter talking to the real mirrors.ubuntu.com:
|
|
|
|
#
|
|
|
|
# MURM="main universe restricted multiverse"
|
|
|
|
# C="$(lsb_release -cs)"
|
|
|
|
# M="mirror://mirrors.ubuntu.com/mirrors.txt"
|
|
|
|
# echo "deb $M $C $MURM" > /etc/apt/sources.list.new
|
|
|
|
# echo "deb $M $C-updates $MURM" >> /etc/apt/sources.list.new
|
|
|
|
# echo "deb $M $C-backports $MURM" >> /etc/apt/sources.list.new
|
|
|
|
# echo "deb $M $C-security $MURM" >> /etc/apt/sources.list.new
|
|
|
|
# mv /etc/apt/sources.list.new /etc/apt/sources.list
|
2020-02-15 17:45:58 +00:00
|
|
|
ENV THIS_MIRROR_URL http://172.17.0.1/ubuntu/
|
|
|
|
|
2016-04-09 13:11:56 +00:00
|
|
|
ADD ./sources.list /etc/apt/sources.list
|
2016-04-08 20:41:48 +00:00
|
|
|
RUN echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d
|
2016-04-11 00:26:57 +00:00
|
|
|
# phusion baseimage says i'm not supposed to do this
|
|
|
|
# and i don't care:
|
|
|
|
RUN apt-get update && apt-get upgrade -y
|
2019-01-25 06:10:37 +00:00
|
|
|
RUN apt-get install -y run-one nginx make debmirror xz-utils
|
2016-04-08 20:41:48 +00:00
|
|
|
|
|
|
|
ADD ./mirror /opt/mirror
|
|
|
|
ADD ./mirror.run /etc/service/mirror/run
|
|
|
|
ADD nginx.conf /etc/nginx/nginx.conf
|
|
|
|
ADD ./nginx.run /etc/service/nginx/run
|
|
|
|
|
|
|
|
RUN chmod +x /etc/service/nginx/run && \
|
|
|
|
chmod +x /etc/service/mirror/run
|
|
|
|
|
|
|
|
RUN \
|
2016-04-08 21:24:53 +00:00
|
|
|
export GNUPGHOME=/etc/debmirror/ubuntu && \
|
|
|
|
mkdir -p $GNUPGHOME && \
|
|
|
|
chmod go-rwx $GNUPGHOME && \
|
2016-04-08 20:41:48 +00:00
|
|
|
gpg --import /usr/share/keyrings/ubuntu-archive-keyring.gpg && \
|
2019-01-25 06:10:37 +00:00
|
|
|
cp $GNUPGHOME/pubring.kbx $GNUPGHOME/trustedkeys.kbx
|
2016-04-08 20:41:48 +00:00
|
|
|
|
2020-02-08 13:30:08 +00:00
|
|
|
|
2016-04-08 20:41:48 +00:00
|
|
|
EXPOSE 80
|