Docker Community Forums

Share and learn in the Docker community.

Port mappings not accessible on Mac

beta

(Archite) #1

Expected behavior

Port would be accessible from host machine if not network…

Actual behavior

Unable to access ports from containers.

Information

Docker for Mac: version: mac-v1.12.0-beta16.2
OS X: version 10.11.5 (build: 15F34)
logs: /tmp/20160622-163525.tar.gz
failure: No error was detected
[OK] docker-cli
[OK] app
[OK] menubar
[OK] virtualization
[OK] system
[OK] osxfs
[OK] db
[OK] slirp
[OK] moby-console
[OK] logs
[OK] vmnetd
[OK] env
[OK] moby
[OK] driver.amd64-linux

Steps to reproduce the behavior

  1. docker run -d -p 80:80 nginx
  2. curl localhost

(David Sheets) #2

This works for me. Does it still fail for you? Are you running any firewalls, network routing software, other virtual machines, other servers, etc?

Thanks for participating in the Docker for Mac Beta!


(Archite) #3

I got a new computer and strangely enough this works. It must have been a configuration issue but I’m not sure what. I’m going through the time machine backup to see if there might be something obvious.


(Ibmrob) #4

I’m hitting exactly the same:

Docker for Mac: version: mac-v1.12.0-beta17
OS X: version 10.11.5 (build: 15F34)
logs: /tmp/20160702-200639.tar.gz
[OK] docker-cli
[OK] app
[OK] menubar
[OK] virtualization
[OK] system
[OK] osxfs
[OK] db
[OK] slirp
[OK] moby-console
[OK] logs
[OK] vmnetd
[OK] env
[OK] moby
[OK] driver.amd64-linux

Steps to reproduce the behavior

When I create a service such as
"docker service create --publish 443:443/tcp --publish 80:80/tcp -e CONSUL_NODE_NAME=INFRA_balancer -e CONSUL_SERVER_ADDRESS=172.17.0.2 -e CONTAINER_NAME=balancer -e LOGMET=true -e LOCAL_DOCKER=true -e CURR_CONN_MAX=10 -e RATE_CONN_MAX=100 -e STATS_DOC_ID=local --name balancer cloud_local/haproxy-balancer:20160615-120845"

I expect a service to be created which listens on 443 and 80 but no ports are opened by the service.

docker ps -a output:

e4efd0e7329a cloud_local/haproxy-balancer:20160615-120845 “supervisord_wrapper” About a minute ago Up About a minute balancer.1.411gv7jsinentnumh5spz08n4