{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/26817","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/26817/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/26817/comments","events_url":"https://api.github.com/repos/docker/docker/issues/26817/events","html_url":"https://github.com/docker/docker/issues/26817","id":178612246,"number":26817,"title":"Docker swarm mode - published ports are not exposed","user":{"login":"JettJones","id":1045582,"avatar_url":"https://avatars.githubusercontent.com/u/1045582?v=3","gravatar_id":"","url":"https://api.github.com/users/JettJones","html_url":"https://github.com/JettJones","followers_url":"https://api.github.com/users/JettJones/followers","following_url":"https://api.github.com/users/JettJones/following{/other_user}","gists_url":"https://api.github.com/users/JettJones/gists{/gist_id}","starred_url":"https://api.github.com/users/JettJones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JettJones/subscriptions","organizations_url":"https://api.github.com/users/JettJones/orgs","repos_url":"https://api.github.com/users/JettJones/repos","events_url":"https://api.github.com/users/JettJones/events{/privacy}","received_events_url":"https://api.github.com/users/JettJones/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-22T13:38:24Z","updated_at":"2016-09-22T14:59:45Z","closed_at":"2016-09-22T14:59:45Z","body":"<!--\r\nFor more information about reporting issues, see\r\nhttps://github.com/docker/docker/blob/master/CONTRIBUTING.md#reporting-other-issues\r\n\r\n---------------------------------------------------\r\nBUG REPORT INFORMATION\r\n---------------------------------------------------\r\nUse the commands below to provide key information from your environment:\r\nYou do NOT have to include this information if this is a FEATURE REQUEST\r\n-->\r\n\r\n**Description**\r\n\r\nWhen exposing ports in swarm mode, the container ports are not exposed.  This is unexpected because similar commands in `docker-compose` or `docker run` do expose the related ports.\r\n\r\nThis issue may affect any existing docker workflows moving to swarm mode, using `docker-compose bundle` or manually.\r\n\r\nI saw this in a larger setup, using consul/registrator for logstash service discovery, when moving a local (`docker-compose.yml`) setup to a cloud provider using swarm mode.  Registrator uses exposed port mappings in reporting service config, so this issue results in missing routes.\r\n\r\n`logstash` is an interesting example because:\r\n1. It doesn't expose any ports by default.\r\n2. The ports it will use are specified by configuration.\r\n3. It's a docker library image.\r\n\r\n**Steps to reproduce the issue:**\r\n0. (this reproduction is running on a single node swarm-mode cluster)\r\n1. `docker service create -p \"5799:5799\" logstash logstash --verbose \"input { http { port => 5799 } }\"`\r\n2. Lookup the service id with `docker ps | grep logstash`\r\n3. `docker inspect -f \"{{.HostConfig.PortMappings}}\" {service_id}`\r\n\r\n**Describe the results you received:**\r\n```\r\nmap[]\r\n```\r\n\r\n**Describe the results you expected:**\r\nCompare this to \r\n1. `docker run -d --name run-logstash -p \"5799:5799\" logstash --verbose \"input { http { port => 5799 } }\"`\r\n2. `docker inspect -f \"{{.HostConfig.PortMappings}}\" run-logstash\r\n```\r\nmap[5799/tcp:[{ 5799}]]\r\n```\r\n\r\nI expect the exposed port to be visible on the container.\r\n\r\n**Output of `docker version`:**\r\n\r\n```\r\n>docker --version\r\nDocker version 1.12.0, build 8eab29e\r\n```\r\n\r\n**Output of `docker info`:**\r\n\r\n```\r\n>docker info\r\nContainers: 3\r\n Running: 2\r\n Paused: 0\r\n Stopped: 1\r\nImages: 27\r\nServer Version: 1.12.1\r\nStorage Driver: aufs\r\n Root Dir: /mnt/sda1/var/lib/docker/aufs\r\n Backing Filesystem: extfs\r\n Dirs: 59\r\n Dirperm1 Supported: true\r\nLogging Driver: json-file\r\nCgroup Driver: cgroupfs\r\nPlugins:\r\n Volume: local\r\n Network: bridge overlay host null\r\nSwarm: active\r\n NodeID: ez8xid0lsy0v0zy4uuqlok84x\r\n Is Manager: true\r\n ClusterID: dqaihqex33qmuvtqsacpwt9jz\r\n Managers: 1\r\n Nodes: 1\r\n Orchestration:\r\n  Task History Retention Limit: 5\r\n Raft:\r\n  Snapshot interval: 10000\r\n  Heartbeat tick: 1\r\n  Election tick: 3\r\n Dispatcher:\r\n  Heartbeat period: 5 seconds\r\n CA configuration:\r\n  Expiry duration: 3 months\r\n Node Address: 192.168.99.100\r\nRuntimes: runc\r\nDefault Runtime: runc\r\nSecurity Options: seccomp\r\nKernel Version: 4.4.17-boot2docker\r\nOperating System: Boot2Docker 1.12.1 (TCL 7.2); HEAD : ef7d0b4 - Thu Aug 18 21:18:06 UTC 2016\r\nOSType: linux\r\nArchitecture: x86_64\r\nCPUs: 1\r\nTotal Memory: 995.9 MiB\r\nName: vbox\r\nID: 6NC5:OVFX:HZU6:NKW5:7N52:35ZR:KXZ2:MNIF:DFUB:4KRT:FBHL:E6PZ\r\nDocker Root Dir: /mnt/sda1/var/lib/docker\r\nDebug Mode (client): false\r\nDebug Mode (server): true\r\n File Descriptors: 44\r\n Goroutines: 139\r\n System Time: 2016-09-22T13:30:25.020549288Z\r\n EventsListeners: 1\r\nRegistry: https://index.docker.io/v1/\r\nLabels:\r\n provider=virtualbox\r\nInsecure Registries:\r\n 127.0.0.0/8\r\n```\r\n\r\n**Additional environment details (AWS, VirtualBox, physical, etc.):**\r\nReproduced locally, running VirtualBox on Windows.\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/248929403","html_url":"https://github.com/docker/docker/issues/26817#issuecomment-248929403","issue_url":"https://api.github.com/repos/docker/docker/issues/26817","id":248929403,"user":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T14:59:45Z","updated_at":"2016-09-22T14:59:45Z","body":"I'll close this issue, because this works as expected, but feel free to continue the discussion "}}
{"actor":{"display_login":"thaJeztah"}}