I'm using docker on ubuntu.
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"
I have this container:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2b20d2dc367c erocci/erocci "/root/run.sh" 11 minutes ago Up 11 minutes 0.0.0.0:8080->80/tcp erocci
So, docker map the exposed port 80 from the container to 8080 in our host. In my machine, the port 8080 is listening.
sudo netstat -an | grep -E "8080"
tcp6 0 0 :::8080 :::* LISTEN
The docker-machine is running on:
docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
OCCIware - virtualbox Running tcp://<IP>:2376
However, when I run
curl http://<IP>:8080/-/
I got this error:
curl: (7) Failed to connect to <IP> port 8080
The version of docker is
docker version
Client:
Version: 1.9.0
API version: 1.21
Go version: go1.4.2
Git commit: 76d6bc9
Built: Tue Nov 3 17:43:42 UTC 2015
OS/Arch: linux/amd64
Server:
Version: 1.9.0
API version: 1.21
Go version: go1.4.2
Git commit: 76d6bc9
Built: Tue Nov 3 17:43:42 UTC 2015
OS/Arch: linux/amd64
and the curl version is :
curl --version
curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
My question is: how can i run curl http://<IP>:8080/-/
properly ?
netstat -ltnp
inside the container would be one possible way. Anlsof
of all processes running the container's cgroup would be another.root@2b20d2dc367c:/# netstat -ltnp
bash: netstat: command not found
lsof
method as well.