0.0.0.0 not accessible from other containers

pauloleitegmail
Fri, 06 Jan 2023 21:03:39 +0000
Docker Desktop

Hi,

I have 2 containers running on Docker created with a docker-compose file and 2 dockerfiles. One of the containers is a CUPS-PDF virtual printer. The other container is a java application.

The CUPS-PDF container is exposed at 631:631 and the cupsd.conf file has the Listen directive set to “Listen 0.0.0.0:631”. I can access both containers from the IDE and from a browser (http://localhost:631). However, the java container cannot connect to the CUPS-PDF container on 0.0.0.0:631. If I stop the java container and run it on my IDE it connects to the CUPS-PDF printer container without any issues and the javax.print.PrintServiceLookUp can detect the printer, so it seems it is something with the docker network that is blocking the access to the CUPS-PDF printer container. Inside the java docker container it can curl to the CUPS-PDF container, however the javax.print.PrintServiceLookUp cannot detect the printer.

I made several tries and created a network for both containers but nothing seems to work.

Any ideas or some information that can be helpful?

15 posts - 4 participants