update readme, fix bugs
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Jeffrey Paul 2020-02-15 10:21:00 -08:00
parent 3e27d9bf26
commit 4ff75ed861
3 changed files with 25 additions and 19 deletions

View File

@ -2,6 +2,7 @@ FROM phusion/baseimage:0.11
VOLUME /var/mirror
ENV MIRROR_INTERVAL_SECONDS 43200
ENV MIRROR_ARCHITECTURES amd64
ENV UBUNTU_SOURCE_MIRROR
ENV MIRROR_CATEGORIES main,universe,restricted,multiverse

View File

@ -1,36 +1,41 @@
# sneak/ubuntumirror
Docker container for syncing bionic ubuntu LTS mirrors
to reduce network traffic and speed up build times.
Docker image for syncing ubuntu LTS mirrors to reduce network traffic and
speed up build times.
Then even your builds (where you can't specify links) will go fast.
Then even your builds (where you can't specify links to other containers by
hostname) will go fast.
# Levers
## Environment Variables
* `MIRROR_ARCHITECTURES`
* default `amd64`.
* default `amd64`.
* You may want `i386,amd64`.
* `MIRROR_CATEGORIES`
* default `main,universe`.
* You may want `main,universe,restricted,multiverse`. Will use lots of
disk.
* Default `main,universe,restricted,multiverse`. Will use lots of disk.
* You may want `main,universe`.
* `UBUNTU_MIRROR_PROJECTS`
* default `xenial,xenial-updates,xenial-security,xenial-backports,bionic,bionic-updates,bionic-security,bionic-backports`.
* `UBUNTU_MIRROR_SOURCE`
* Default
`bionic,bionic-updates,bionic-security,bionic-backports,focal,focal-updates,focal-security,focal-backports`.
* You may want only `focal,focal-updates,focal-security,focal-backports`.
* `UBUNTU_MIRROR_SOURCE` - upstream server to mirror from
* default `archive.ubuntu.com`.
* You may want `xx.archive.ubuntu.com` (where `xx` is your country
code).
* `MIRROR_INTERVAL_SECONDS` - mirror sync interval
* `UBUNTU_SOURCE_MIRROR` - do we want to mirror all the source code too?
* Default ``
* You may want `1` if you want to use up even more disk for your mirror
* `MIRROR_INTERVAL_SECONDS` - mirror update interval
* default `43200` (12h)
* You may want `10800` (3h)
# Example dnsmasq setup
# Example CapRover Definition File
```
apt update && apt -y install dnsmasq
echo address=/mirrors.ubuntu.com/172.17.0.1 > /etc/dnsmasq.d/ubuntu-mirror-local
{
"schemaVersion": 2,
"imageName": "sneak/ubuntumirror:latest"
}
```
Then, just add `--dns 172.17.0.1` to your /etc/default/docker opts
and bounce the docker daemon. Future containers will talk to your local
mirror.

View File

@ -6,8 +6,8 @@ export HOME=/root
# cleanup previous runs
rm -rf /var/mirror/ubuntu/.temp
while true ; do
while sleep 1 ; do
cd /opt/mirror && make
sleep ${MIRROR_INTERVAL_SECONDS:-43200}
sleep ${MIRROR_INTERVAL_SECONDS}
done