FROM quay.io/wildfly/wildfly:26.1.3.Final-jdk11
RUN /opt/jboss/wildfly/bin/add-user.sh admin admin --silent
COPY my-standalone.xml /opt/jboss/wildfly/standalone/configuration/
COPY myapp.war /opt/jboss/wildfly/standalone/deployments/
COPY module.xml /opt/jboss/wildfly/modules/system/layers/base/com/mysql/main/
COPY mysql-connector-java-8.0.12.jar /opt/jboss/wildfly/modules/system/layers/base/com/mysql/main/
EXPOSE 8080 9990
# Run with custom configuration
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c","my-standalone.xml"]
If I start docker my wildfly application and server it´s running.
But I have also a dependency to a Keyclock application, which runs on my local machine (another process, not from docker…).
It seems Docker is not able to use this from my application.
The URL from Keyclock is: http://0.0.0.0:9009/auth
What do I need to change?
And my second question is, if I use on top a docker-compose.yaml file, which is also using the Dockerfile. Do I need to change something also there to get Keyclock running / considering?
0.0.0.0 is not an ip address as such, but it indicates to “listen on all available IP addresses” to an application.
To connect to a service listening on 0.0.0.0, you need to use a real IP address. The host usually has localhost/127.0.0.1 and a custom one like 12.34.56.78. As localhost within a container is really only localhost within container, not on host, you must use the other IP to connect.
Thank you - you are right: http://localhost:9009/auth is also working.
But I still don´t understand where I have to define this URL in the Dockerfile or docker-compose.yaml file ?
… unless the container uses the host network. Since we never saw the compose file, it could be why @vished2000 repots that localhost is working for him.
The only reason why I would use the host network, is when I have a container that needs to act on udp broadcast traffic. For everything else I would not want to lose the network namespace isolation provided by bridge networks.