Transparent Squid Proxy for docker/compose envs to accelerate the image reconstruction.
2.2K
This is an Squid-Proxy that act like an 'transparent-proxy' to accelerate the docker-image recontrstuction.
This solution are based on squid-in-a-can project, developed by ©Jérôme Petazzoni.
docker-engine >= 1.12docker-compose >= 1.8.1docker run need --privileged and --network host flag.docker run)You can manually run these commands:
docker run -d --privileged --network host mgvazquez/squid-proxy
There is a docker-compose.yml file to enable launching via docker compose.
To use this you will need a
local checkout of this repo and have docker and compose installed.
Run the following command in the same directory as the
docker-compose.ymlfile:
docker-compose up
You can customize the docker-compose.yml:
version: '2'
volumes:
squid_cache:
services:
squid-proxy:
image: mgvazquez/squid-proxy
hostname: squid-proxy
container_name: squid-proxy
network_mode: host
privileged: true
volumes:
- squid_cache:/var/cache/squid
- /etc/localtime:/etc/localtime
environment:
- SQUID_LISTEN_PORT=3128
- SQUID_MAX_CACHE_SIZE=5000
- SQUID_MAX_CACHE_OBJECT=1024
The docker image can be tuned using environment variables.
Squid listening port. Use the -e SQUID_LISTEN_PORT=1024 to set the listening port.
Squid has a maximum object cache size. Often when caching debian packages vs standard web content it is valuable to increase this size. Use the -e SQUID_MAX_CACHE_OBJECT=1024 to set the max object size (in MB).
The squid disk cache size can be tuned. Use -e SQUID_MAX_CACHE_SIZE=5000 to set the disk cache size (in MB).
Content type
Image
Digest
Size
19.1 MB
Last updated
almost 10 years ago
docker pull mgvazquez/squid-proxy