Skip to content

Instantly share code, notes, and snippets.

@johnzielke
Last active May 5, 2021 15:16
Show Gist options
  • Save johnzielke/da6e82e39235f70baee95d699c23b96b to your computer and use it in GitHub Desktop.
Save johnzielke/da6e82e39235f70baee95d699c23b96b to your computer and use it in GitHub Desktop.
Apt proxy (for docker)
// Install apt-cacher before https://wiki.ubuntuusers.de/Lokale_Paketquellen/Apt-Cacher-ng/
// Run with docker build --network="host"
// https://stackoverflow.com/questions/47067944/how-to-access-the-hosts-machines-localhost-127-0-0-1-from-docker-container
//Copy to /etc/apt/apt.conf.d/
Acquire::http { Proxy "http://localhost:3142"; };
Acquire::https { Proxy "https://"; };
---
version: '3'
services:
apt-cacher-ng:
image: sameersbn/apt-cacher-ng
container_name: apt-cacher-ng
network_mode: "host"
volumes:
- apt-cacher-ng:/var/cache/apt-cacher-ng
restart: always
volumes:
apt-cacher-ng:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment