Alpine container with Squid configured for basic authentication and domain block lists.
181
Alpine container with Squid configured for basic authentication and domain block lists.
Start the container.
docker run --name squid -d -p 3128:3128 --restart always jonathanfoster/squid
Squid is configured to use basic authentication. Local traffic does not require authentication. Create users using
htpasswd.
docker exec -it squid htpasswd -c /etc/squid/passwd $USERNAME
The domain block list is stored in /etc/squid/blocklist. You can block a specific subdomain
(e.g. www.reddit.com) or all subdomains (e.g. .reddit.com). Each blocked domain must be listed on a separate line.
If the block list changes, you have to force Squid to reload the list by sending a SIGHUP signal.
docker exec squid mkdir /etc/squid/blocklist/
docker exec squid sh -c "echo '.reddit.com' > /etc/squid/blocklist"
docker kill -s HUP squid
For debugging and maintenance purposes, you may want to access the container's shell.
docker exec -it squid sh
Content type
Image
Digest
Size
5.8 MB
Last updated
over 8 years ago
docker pull jonathanfoster/squid