summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2015-01-22 12:18:48 +0100
committerTails developers <amnesia@boum.org>2015-01-22 12:18:48 +0100
commit39a75bf297a9d0f3c7424bbebfb93b12c72cd4cd (patch)
tree00ea2e4d0bf364cddb51b14145832e41ab9c3013
parentc168004832a1f821b424e5270f9e8d88defda4b2 (diff)
WIP for using apt-cacher-ng with our Docker-based builder.feature/7530-docker-with-apt-cacher-ng
-rw-r--r--Makefile4
-rw-r--r--docker/apt_cacher/Dockerfile18
-rw-r--r--docker/apt_cacher/provision/assets/apt/preferences3
-rw-r--r--docker/apt_cacher/provision/assets/apt/sources.list4
-rw-r--r--docker/apt_cacher/provision/assets/config/acng.conf12
5 files changed, 41 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b5bc6dd..7b01545 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
#CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
#DOCKER_IMAGE_NAME := "tails$(if $(CURRENT_BRANCH),-$(CURRENT_BRANCH))"
+CACHER_IMAGE := "apt_cacher"
BUILDER_IMAGE := "tails_builder"
BUILDER_MOUNT := "$(shell pwd):/root/tails"
DOCKER_RUN_IN_BUILDER := docker run --rm --privileged -v $(BUILDER_MOUNT) -t $(BUILDER_IMAGE)
@@ -17,6 +18,9 @@ containers: builder_container
builder_container: docker/tails_builder/provision/assets/apt/deb.tails.boum.org.key
docker build -t "$(BUILDER_IMAGE)" docker/tails_builder
+cacher_container:
+ docker build -t "$(CACHER_IMAGE)" docker/$(CACHER_IMAGE)
+
# Docker cannot COPY files from outside of its context (i.e. where the
# Dockerfile is stored) so we have to make it available in there while
# being careful its not a symlink, hence the `--dereference`. Also
diff --git a/docker/apt_cacher/Dockerfile b/docker/apt_cacher/Dockerfile
new file mode 100644
index 0000000..edf3798
--- /dev/null
+++ b/docker/apt_cacher/Dockerfile
@@ -0,0 +1,18 @@
+FROM debian:wheezy
+MAINTAINER tails@boum.org
+
+VOLUME ["/var/cache/apt-cacher-ng"]
+
+COPY provision/assets/apt/sources.list /etc/apt/sources.list
+COPY provision/assets/apt/preferences /etc/apt/preferences.d/tails
+
+RUN apt-get update && \
+ apt-get upgrade --assume-yes && \
+ apt-get install --assume-yes --no-install-recommends \
+ apt-cacher-ng/wheezy-backports
+
+COPY provision/assets/config/acng.conf /etc/apt-cacher-ng/acng.conf
+
+EXPOSE 3142
+
+CMD /usr/sbin/apt-cacher-ng ForeGround=1 CacheDir=/var/cache/apt-cacher-ng
diff --git a/docker/apt_cacher/provision/assets/apt/preferences b/docker/apt_cacher/provision/assets/apt/preferences
new file mode 100644
index 0000000..4b685fc
--- /dev/null
+++ b/docker/apt_cacher/provision/assets/apt/preferences
@@ -0,0 +1,3 @@
+Package: *
+Pin: release o=Debian,n=wheezy
+Pin-Priority: 990
diff --git a/docker/apt_cacher/provision/assets/apt/sources.list b/docker/apt_cacher/provision/assets/apt/sources.list
new file mode 100644
index 0000000..97de362
--- /dev/null
+++ b/docker/apt_cacher/provision/assets/apt/sources.list
@@ -0,0 +1,4 @@
+deb http://ftp.us.debian.org/debian wheezy main
+deb http://security.debian.org/ wheezy/updates main
+deb http://ftp.us.debian.org/debian/ wheezy-updates main
+deb http://ftp.us.debian.org/debian wheezy-backports main
diff --git a/docker/apt_cacher/provision/assets/config/acng.conf b/docker/apt_cacher/provision/assets/config/acng.conf
new file mode 100644
index 0000000..f627bd4
--- /dev/null
+++ b/docker/apt_cacher/provision/assets/config/acng.conf
@@ -0,0 +1,12 @@
+CacheDir: /var/cache/apt-cacher-ng
+LogDir: /var/log/apt-cacher-ng
+Port:3142
+Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian
+Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu
+Remap-debvol: file:debvol_mirror*.gz /debian-volatile ; file:backends_debvol
+Remap-cygwin: file:cygwin_mirrors /cygwin # ; file:backends_cygwin # incomplete, please create this file
+ReportPage: acng-report.html
+ExTreshold: 4
+VfilePattern = (^|.*?/)(Index|Packages(\.gz|\.bz2|\.lzma|\.xz)?|InRelease|Release|Release\.gpg|Sources(\.gz|\.bz2|\.lzma|\.xz)?|release|index\.db-.*\.gz|Contents-[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|pkglist[^/]*\.bz2|rclist[^/]*\.bz2|/meta-release[^/]*|Translation[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|MD5SUMS|SHA1SUMS|((setup|setup-legacy)(\.ini|\.bz2|\.hint)(\.sig)?)|mirrors\.lst|repo(index|md)\.xml(\.asc|\.key)?|directory\.yast|products|content(\.asc|\.key)?|media|filelists\.xml\.gz|filelists\.sqlite\.bz2|repomd\.xml|packages\.[a-zA-Z][a-zA-Z]\.gz|info\.txt|license\.tar\.gz|license\.zip|.*\.db(\.tar\.gz)?|.*\.files\.tar\.gz|.*\.abs\.tar\.gz|metalink\?repo|.*prestodelta\.xml\.gz)$|/dists/.*/installer-[^/]+/[^0-9][^/]+/images/.*
+PfilePattern = .*(\.d?deb|\.rpm|\.dsc|\.tar(\.gz|\.bz2|\.lzma|\.xz)(\.gpg)?|\.diff(\.gz|\.bz2|\.lzma|\.xz)|\.o|\.jigdo|\.template|changelog|copyright|\.udeb|\.debdelta|\.diff/.*\.gz|(Devel)?ReleaseAnnouncement(\?.*)?|[a-f0-9]+-(susedata|updateinfo|primary|deltainfo).xml.gz|fonts/(final/)?[a-z]+32.exe(\?download.*)?|/dists/.*/installer-[^/]+/[0-9][^/]+/images/.*)$
+WfilePattern = (^|.*?/)(Release|InRelease|Release\.gpg|(Packages|Sources)(\.gz|\.bz2|\.lzma|\.xz)?|Translation[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|MD5SUMS|SHA1SUMS|.*\.xml|.*\.db\.tar\.gz|.*\.files\.tar\.gz|.*\.abs\.tar\.gz|[a-z]+32.exe)$|/dists/.*/installer-.*/images/.*