ERR_ACCESS_DENIED: No access by default
I've run container with docker run sameersbn/squid command, noted the IP with docker inspect X.
However, when I'm trying to test with curl it reads ERR_ACCESS_DENIED.
$ export http_proxy=http://172.17.0.3:3128
$ curl http://example.com/
...
<!-- ERR_ACCESS_DENIED -->
...
Is it possible to configure container to have the allow access by default? Or what's the easiest way to achieve that?
Yes, that's super confusing. WTF? I need clear message that it is unusable by default.
Here is how I copied out the default config file from the image and modified it to allow for all
# Assuming we are running a non-configured / default Squid container as `squid`
docker run --name squid -d sameersbn/squid:3.5.27-2
docker cp squid:/etc/squid/squid.conf ./squid.conf.default
sed 's/http_access deny all/http_access allow all/' ./squid.conf.default > ./squid.conf
You'd then just need to mount this config file as a volume when running the container
Thanks @mt-kelvintaywl, thats a great way to do it.
I wanted to use this in a custom Docker image without having to copy along the squid.conf, I ended up using it like this:
FROM sameersbn/squid:3.5.27-2
RUN cp /etc/squid/squid.conf /etc/squid/squid.conf.default && \
sed 's/http_access deny all/http_access allow all/' \
/etc/squid/squid.conf.default > /etc/squid/squid.conf