Skip to content

Instantly share code, notes, and snippets.

@voxxit
Forked from fairchild/Dockerfile
Last active August 29, 2015 14:08
Show Gist options
  • Save voxxit/9df936e292aa026f311e to your computer and use it in GitHub Desktop.
Save voxxit/9df936e292aa026f311e to your computer and use it in GitHub Desktop.
basic dockerfile for apt-cacher-ng

Running

docker run -d -v /var/cache/apt-cacher-ng --name apt-cache-data tianon/true
docker run -d -p 3142:3142 --volumes-from apt-cache-data --name apt-cache voxxit/apt-cacher-ng

Using

FROM debian:jessie

RUN echo 'Acquire::http::Proxy "http://172.17.42.1:3142";' | tee /etc/apt/apt.conf.d/02proxy \
  && apt-get update \
  && apt-get -y upgrade

...or just use voxxit/cached-base ;-)

Building Locally

docker build -t voxxit/apt-cacher-ng "https://gist.github.com/9df936e292aa026f311e.git"
FROM debian:jessie
MAINTAINER [email protected]
EXPOSE 3142
VOLUME [ "/var/cache/apt-cacher-ng" ]
RUN apt-get update \
&& apt-get install -y apt-cacher-ng \
&& echo "Acquire::http { Proxy \"http://127.0.0.1:3142\"; };" | tee /etc/apt/apt.conf.d/01proxy
CMD [ "/usr/sbin/apt-cacher-ng", "ForeGround=1" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment