Dockerfile 769 B

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