This is an Squid-Proxy that acts as a 'transparent-proxy' to accelerate the docker-image reconstruction.
This solution is 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.
- Can't handle HTTPS for now.
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.yml
file:
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).
- To handle HTTPS requests with custom trusted certificates.