I'm trying to connect to a container in a CentOS machine and after searching for a solution on the internet, I still can't do it.

In fact, I have two CentOS machines and on both I have the same Docker version:

 Version:       17.12.0-ce
 API version:   1.35
 Go version:    go1.9.2
 Git commit:    c97c6d6
 Built: Wed Dec 27 20:10:14 2017
 OS/Arch:       linux/amd64

  Version:      17.12.0-ce
  API version:  1.35 (minimum version 1.12)
  Go version:   go1.9.2
  Git commit:   c97c6d6
  Built:        Wed Dec 27 20:12:46 2017
  OS/Arch:      linux/amd64
  Experimental: false

I create the container on both using the following command:

docker run -d --security-opt="seccomp:unconfined" --name test -it -p 859:830 -p 4309:4183 -p 469:443 myimage

Now, for both machines, if I use the following command from outside, I can see that the ports are open:

nmap <ip> -p 4309

With the following result:

Starting Nmap 5.51 ( http://nmap.org ) at 2019-03-21 09:18 WET
Nmap scan report for <myhostname> (<myip>)
Host is up (0.0012s latency).
4309/tcp open  unknown

Nmap done: 1 IP address (1 host up) scanned in 0.20 seconds

The problem is that on one machine I'm unable to reach from outside. I don't have any clue of what may be blocking this even after trying to see if anyone had the same issues. Any clue? How can I debug this more?

Thank you.

  • Have you confirmed that the containers are running after starting in detached mode? Run the docker ps command before running the nmap from outside. – KatariaA Mar 21 at 15:14
  • Yes they are running. It seems it's something internall to the container. I installed portainer and it works as expected. – zephirus Mar 21 at 17:36
  • "Can't access" and "CentOS" could be an issue with SELinux, did you check your audit.log file? – Michael D. Mar 25 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.