Sign inSign up

mgvazquez/squid-proxy

By mgvazquez

Updated almost 10 years ago

Transparent Squid Proxy for docker/compose envs to accelerate the image reconstruction.

Image
1

2.2K

mgvazquez/squid-proxy repository overview

Docker Squid Proxy

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 Image


Requirements
  • docker-engine >= 1.12
  • docker-compose >= 1.8.1
  • docker run need --privileged and --network host flag.

Limitations

How-to
Manually (with docker run)

You can manually run these commands:

docker run -d --privileged --network host mgvazquez/squid-proxy
Run via docker-compose

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
Tuning

The docker image can be tuned using environment variables.

SQUID_LISTEN_PORT

Squid listening port. Use the -e SQUID_LISTEN_PORT=1024 to set the listening port.

SQUID_MAX_CACHE_OBJECT

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).

SQUID_MAX_CACHE_SIZE

The squid disk cache size can be tuned. Use -e SQUID_MAX_CACHE_SIZE=5000 to set the disk cache size (in MB).


To-Do
  • To handle HTTPS requests with custom trusted certificates.

Tag summary

Content type

Image

Digest

Size

19.1 MB

Last updated

almost 10 years ago

docker pull mgvazquez/squid-proxy