docker-squid icon indicating copy to clipboard operation
docker-squid copied to clipboard

ERR_ACCESS_DENIED: No access by default

Open kenorb opened this issue 6 years ago • 3 comments

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?

kenorb avatar May 20 '19 13:05 kenorb

Yes, that's super confusing. WTF? I need clear message that it is unusable by default.

ro31337 avatar Jul 06 '19 16:07 ro31337

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

mt-kelvintaywl avatar Sep 11 '19 04:09 mt-kelvintaywl

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

beeman avatar Feb 09 '20 00:02 beeman