sorry for my stupid question. I'm using docker and i try to expose port to localhost. I'm using the following command line:
docker run -d -p 127.0.0.1:8080:8081 --name nexus sonatype/nexus
And I'm executing the following command:
wget nexus:8080
--2015-03-26 19:31:58-- http://nexus:8080/
Résolution de nexus (nexus)... 127.0.53.53
Connexion vers nexus (nexus)|127.0.53.53|:8080...échec: Connexion refusée.
I have issue with ping command however why, I can't find nexus server.
I have check and all port are open on (iptables).
Thanks
Where are you running the wget from? You've only bound to the localhost interface on the host, so you will only be able to access the container from the host itself. Does it work if you use 0.0.0.0:8080:8081 in the docker run command? IIRC 0.0.0.0 is the default, so just 8080:8081 should also work.
If you don't want to make the port accessible to anyone outside the local network, use your local IP address, which you can find by running ifconfig. For example, my IP on the local network is 192.168.1.103, so I would do:
docker run -d -p 192.168.1.103:8080:8081 --name nexus sonatype/nexus
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With