update readme, fix some bugs
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Jeffrey Paul 2020-02-15 10:29:22 -08:00
parent 4ff75ed861
commit d90e22b44f
4 changed files with 36 additions and 27 deletions

View File

@ -2,11 +2,12 @@ FROM phusion/baseimage:0.11
VOLUME /var/mirror VOLUME /var/mirror
ENV MIRROR_INTERVAL_SECONDS 43200 ENV MIRROR_UPDATE_INTERVAL_SECONDS 43200
ENV MIRROR_ARCHITECTURES amd64 ENV UBUNTU_MIRROR_ARCHITECTURES amd64
ENV UBUNTU_SOURCE_MIRROR # set to anything but 'false' to mirror source code as well
ENV MIRROR_CATEGORIES main,universe,restricted,multiverse ENV UBUNTU_ENABLE_SOURCE_MIRRORING false
ENV UBUNTU_MIRROR_SOURCE archive.ubuntu.com ENV UBUNTU_MIRROR_CATEGORIES main,universe,restricted,multiverse
ENV UBUNTU_MIRROR_UPSTREAM archive.ubuntu.com
ENV UBUNTU_MIRROR_PROJECTS bionic,bionic-updates,bionic-security,bionic-backports,focal,focal-updates,focal-security,focal-backports ENV UBUNTU_MIRROR_PROJECTS bionic,bionic-updates,bionic-security,bionic-backports,focal,focal-updates,focal-security,focal-backports
# The following is the URL populated in /mirrors.txt as used by mirror:// # The following is the URL populated in /mirrors.txt as used by mirror://

View File

@ -8,29 +8,49 @@ hostname) will go fast.
# Levers # Levers
## Paths
The mirror stores all the data in a docker volume at path
`/var/mirror/ubuntu`. Map that somewhere else if you like.
## Environment Variables ## Environment Variables
* `MIRROR_ARCHITECTURES` * `UBUNTU_MIRROR_ARCHITECTURES`
* default `amd64`. * default `amd64`.
* You may want `i386,amd64`. * You may want `i386,amd64`.
* `MIRROR_CATEGORIES` * `UBUNTU_MIRROR_CATEGORIES`
* Default `main,universe,restricted,multiverse`. Will use lots of disk. * Default `main,universe,restricted,multiverse`. Will use lots of disk.
* You may want `main,universe`. * You may want `main,universe`.
* `UBUNTU_MIRROR_PROJECTS` * `UBUNTU_MIRROR_PROJECTS`
* Default * Default
`bionic,bionic-updates,bionic-security,bionic-backports,focal,focal-updates,focal-security,focal-backports`. `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`. * You may want only `focal,focal-updates,focal-security,focal-backports`.
* `UBUNTU_MIRROR_SOURCE` - upstream server to mirror from * `UBUNTU_MIRROR_UPSTREAM` - upstream server to mirror from
* default `archive.ubuntu.com`. * default `archive.ubuntu.com`.
* You may want `xx.archive.ubuntu.com` (where `xx` is your country * You may want `xx.archive.ubuntu.com` (where `xx` is your country
code). code).
* `UBUNTU_SOURCE_MIRROR` - do we want to mirror all the source code too? * `UBUNTU_ENABLE_SOURCE_MIRRORING` - do we want to mirror all the source code too?
* Default `` * Default ``
* You may want `1` if you want to use up even more disk for your mirror * You may want `1` if you want to use up even more disk for your mirror
* `MIRROR_INTERVAL_SECONDS` - mirror update interval * `MIRROR_UPDATE_INTERVAL_SECONDS` - mirror update interval
* default `43200` (12h) * default `43200` (12h)
* You may want `10800` (3h) * You may want `10800` (3h)
# Example Startup
```
docker rm -f local-ubuntu-mirror
docker run -d --name local-ubuntu-mirror \
-v /storage/mirrors/ubuntu:/var/mirror/ubuntu \
--env MIRROR_UPDATE_INTERVAL_SECONDS=3600 \
--env UBUNTU_MIRROR_ARCHITECTURES=amd64 \
--env UBUNTU_MIRROR_UPSTREAM=us.archive.ubuntu.com \
--env UBUNTU_MIRROR_PROJECTS=focal,focal-updates,focal-security,focal-backports \
-p 8080:80 \
--restart unless-stopped \
sneak/ubuntumirror:latest
```
# Example CapRover Definition File # Example CapRover Definition File
``` ```

View File

@ -1,12 +0,0 @@
#!/bin/bash
docker rm -f local-ubuntu-mirror
docker run -d --name local-ubuntu-mirror \
-v /storage/mirrors/ubuntu:/var/mirror/ubuntu \
--env MIRROR_INTERVAL_SECONDS=10800 \
--env MIRROR_ARCHITECTURES=amd64 \
--dns 8.8.8.8 \
--dns 8.8.4.4 \
-p 8080:80 \
--restart unless-stopped \
sneak/ubuntumirror:latest

View File

@ -12,16 +12,16 @@ mkdir -p "$DST/ubuntu"
export GNUPGHOME="/etc/debmirror/ubuntu" export GNUPGHOME="/etc/debmirror/ubuntu"
SOURCEOPT="--nosource" SOURCEOPT="--nosource"
if [[ ! -z "$UBUNTU_SOURCE_MIRROR" ]]; then if [[ "$UBUNTU_ENABLE_SOURCE_MIRRORING" != "false" ]]; then
SOURCEOPT="--source" SOURCEOPT="--source"
fi fi
debmirror \ debmirror \
-a ${MIRROR_ARCHITECTURES} \ -a ${UBUNTU_MIRROR_ARCHITECTURES} \
$SOURCEOPT \ -s ${UBUNTU_MIRROR_CATEGORIES} \
-s ${MIRROR_CATEGORIES} \ -h ${UBUNTU_MIRROR_UPSTREAM} \
-h ${UBUNTU_MIRROR_SOURCE} \
-d ${UBUNTU_MIRROR_PROJECTS} \ -d ${UBUNTU_MIRROR_PROJECTS} \
$SOURCEOPT \
--ignore-small-errors \ --ignore-small-errors \
-r /ubuntu \ -r /ubuntu \
--getcontents \ --getcontents \