Docker Community Forums

Share and learn in the Docker community.

Can't ping / access docker host on from inside a container

My docker host listens on

I can curl it from the host machine, but when I curl the same ip/port from within the container I get timeout.

I can ping anything from withing the container but I can’t access the host.

What am I missing ?

Container is Jenkins image run by this command:

docker run -d --name jenkins -v jenkins_home:/var/jenkins_home -p 8080:8080 -p 50000:50000 jenkins/jenkins:2.222.3

Running curl on the host:

curl {“message”:“page not found”}

Running curl from withing the docker will time out.

curl curl: (7) Failed to connect to port 2375: Connection timed out

Your’re exposing only port 8080 and 50000 … not 2375

the 2375 is being exposed by the HOST not by the container. I want to be able to call the docker api from the container - the daemon runs and listen on

Hmmm … maybe this will help