A Docker image that builds Squid v7 from source on Ubuntu 26.04, with SSL/TLS bump support baked in.
- Built from source — clones the Squid v7 branch and compiles with Ubuntu-hardened compiler flags (stack protector, FORTIFY_SOURCE, RELRO, etc.).
- SSL Bump / HTTPS interception — compiled with
--enable-ssl-crtdand--with-openssl; the entrypoint auto-generates the TLS certificate cache on startup. - Multi-stage build — final image contains only runtime dependencies (
ca-certificates,libltdl7), keeping it small. - Runs as non-root — the container runs as the
proxyuser.
docker build -t squid .docker run -d \
-p 3128:3128 \
-v squid-state:/squid-state \
-v /path/to/squid.conf:/etc/squid/squid.conf:ro \
squid| Mount | Purpose |
|---|---|
/squid-state |
Persistent TLS certificate database (ssl_db) |
/etc/squid/squid.conf |
Your Squid configuration file |
Squid listens on port 3128 by default.
Access and store logs are tailed to stdout automatically by the entrypoint, so docker logs works out of the box.
- Builder stage — installs build dependencies, clones Squid v7, bootstraps, configures with a comprehensive set of features (ESI, ICAP, delay pools, cache digests, etc.), and compiles.
- Runtime stage — copies the built artifacts into a clean Ubuntu 26.04 image with only the required shared libraries, sets ownership for the
proxyuser, and usesentrypoint.shto initialize caches before starting Squid in the foreground.
The entrypoint.sh script:
- Generates the TLS certificate cache at
/squid-state/ssl_db. - Creates Squid swap/cache directories (
squid -zN). - Tails access and store logs to stdout.
- Starts Squid in the foreground (
squid -NYCd 1).