You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am able to launch containers and map their ports from the CLI. However, the same thing seems impossible through the Remote API. In both cases I'm running with docker-machine on Mac OS El Capitan.
I have now simplified the test case to the absolute bare minimum, which is based on a standard ubuntu image with just a single package netcat-openbsd, apt-get installed (and run as nc).
Resetting the system
Before each test, I run
eval$(docker-machine env default); docker stop $(docker ps -a -q); docker rm $(docker ps -a -q)
...to stop and remove all previous containers.
CLI Version (addressable)
The following CLI successfully brings up an addressable service...
I can prove the service is accessible with properly-mapped ports from outside the docker container (at the IP allocated to the VM by docker-machine) by running the following...
However, it does not apparently respect the external port mapping which has been requested, so if I restart the working test above from scratch, then attempt to access the service from outside the container in the same way as 'Proving Addressable Service' earlier, it reports a failed connection.
$ nc -v 192.168.99.100 3000
nc: connectx to 192.168.99.100 port 3000 (tcp) failed: Connection refused
Extra Debugging Information
Output of docker version:
bash-3.2$ docker version
Client:
Version: 1.10.1
API version: 1.22
Go version: go1.5.3
Git commit: 9e83765
Built: Fri Feb 12 22:11:40 UTC 2016
OS/Arch: darwin/amd64
Server:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 21:20:08 2016
OS/Arch: linux/amd64
wait, what? was that it?...a typo?
I have been reading this because I have the same problem -- cannot get any port-mapping to work, no Network IP address.
( but I don't have your typo )
Is there nothing else to be learned here?
never mind...I have learned something : after creating a container you then have to "start()" the container before you get an IP Address or port mappings.
I am able to launch containers and map their ports from the CLI. However, the same thing seems impossible through the Remote API. In both cases I'm running with docker-machine on Mac OS El Capitan.
I have now simplified the test case to the absolute bare minimum, which is based on a standard ubuntu image with just a single package netcat-openbsd, apt-get installed (and run as
nc
).Resetting the system
Before each test, I run
...to stop and remove all previous containers.
CLI Version (addressable)
The following CLI successfully brings up an addressable service...
docker run -it --rm -p 3000:3000 ubuntu-nc /bin/bash -c 'echo "Working" | nc -l 3000'
Proving Addressable Service
I can prove the service is accessible with properly-mapped ports from outside the docker container (at the IP allocated to the VM by docker-machine) by running the following...
NodeJS Version (not addressable)
Attempting to bring up the same service via Dockerode on Node creates a service which is not addressable, even though Dockerode apparently passes on all the arguments to Docker, and I am apparently conforming to the conventions of https://godoc.org/github.com/docker/engine-api/types/container#Config and https://godoc.org/github.com/docker/engine-api/types/container#HostConfig hence raising this issue.
This is the code I'm attempting to use...
The NodeJS version definitely runs the service in the container
For example I can access the service from within its own container...
However, it does not apparently respect the external port mapping which has been requested, so if I restart the working test above from scratch, then attempt to access the service from outside the container in the same way as 'Proving Addressable Service' earlier, it reports a failed connection.
Extra Debugging Information
Output of
docker version
:Output of
docker info
:The text was updated successfully, but these errors were encountered: