123456789101112131415161718192021222324 |
- #
- # Build: docker build -t apt-cacher .
- # Run: docker run -d -p 3142:3142 --name apt-cacher-run apt-cacher
- #
- # and then you can run containers with:
- # docker run -t -i --rm -e http_proxy http://dockerhost:3142/ debian bash
- #
- # Here, `dockerhost` is the IP address or FQDN of a host running the Docker daemon
- # which acts as an APT proxy server.
- FROM debian:stretch-slim
- EXPOSE 3142
- ARG UID
- VOLUME ["/var/cache/apt-cacher-ng"]
- RUN apt-get update && apt-get install -y apt-cacher-ng && \
- sed -i "s%# ForeGround: 0%ForeGround: 1%g" /etc/apt-cacher-ng/acng.conf && \
- chown -R $UID /etc/apt-cacher-ng && \
- chown -R $UID /var/log/apt-cacher-ng && \
- rm -rf /var/lib/apt/lists/*
-
- USER UID
- CMD ["/usr/sbin/apt-cacher-ng", "-c", "/etc/apt-cacher-ng"]
|