So I am setting things up so that I have two docker containers, a squid container and an e2guardian container, where the e2guardian is an ICAP service. I am connecting these two containers to the same network and giving them names squid and e2guardian, respectively.
I added the following lines to my squid config: icap_service service_req reqmod_precache bypass=0 icap://e2guardian:1344/request
But when I try to access I get an ICAP error, and the following log message:
essential ICAP service is down after an options fetch failure: icap://e2guardian:1344/request [down,!opt]
If I exec into the docker container and ping e2guardian, it resolves fine. If I take the IP address of the docker container and add it to that ICAP line in my squid.conf, it works just fine. But I don't want to have to do this obviously because I don't know what the IP of the docker container will be when it comes up.
I should also mention that if I manually add the docker IP to my /etc/hosts file on the squid container and give it the hostname of e2guardian, it still doesn't work. This inclines me to believe that, for some reason, no name resolution of any kind is performed when resolving the ICAP service.