From cabc1dbeb9b04e60aac43fe1be5294c55fbae806 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Sat, 9 Apr 2016 15:22:33 +0200 Subject: [PATCH] latest --- Makefile | 3 +++ README.markdown | 42 ++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 13 +++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 README.markdown create mode 100644 docker-compose.yml diff --git a/Makefile b/Makefile index 94fd1e8..459fbd4 100644 --- a/Makefile +++ b/Makefile @@ -2,3 +2,6 @@ default: build build: docker build -t sneak/ubuntumirror . + +deploy: + docker-compose --project-name local up mirror diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..f4a983b --- /dev/null +++ b/README.markdown @@ -0,0 +1,42 @@ +# sneak/ubuntumirror + +Docker container for syncing trusty and xenial ubuntu LTS mirrors +to reduce network traffic and speed up build times. + +I recommend deploying this with a `--dns 172.17.0.1` in your +`/etc/default/docker` and dnsmasq bound to 172.17.0.1:53 to rewrite +`archive.ubuntu.com` to `172.17.0.1` (which this image will be listening and +serving on). + +Then even your builds (where you can't specify links) will go fast. + +# Levers + +* `MIRROR_ARCHITECTURES` + * default `amd64`. + * You may want `i386,amd64`. +* `MIRROR_CATEGORIES` + * default `main,universe`. + * You may want `main,universe,restricted,multiverse`. Will use lots of + disk. +* `UBUNTU_MIRROR_SOURCE` + * default `archive.ubuntu.com`. + * You may want `xx.archive.ubuntu.com` (where `xx` is your country + code). + +# Example dnsmasq setup + +``` +apt-get update && apt-get -y install dnsmasq +cat > /etc/dnsmasq.d/docker <> /etc/hosts +service dnsmasq restart +``` + +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. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c3a2c65 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '2.0' + +services: + mirror: + hostname: mirror + image: sneak/ubuntumirror + network_mode: bridge + volumes: + - "/storage/nobackup/mirrors:/var/mirror" + ports: + - "172.17.0.1:80:80" + environment: + - UBUNTU_MIRROR_SOURCE=de.archive.ubuntu.com