{"action":"opened","issue":{"url":"https://api.github.com/repos/docker/docker/issues/23388","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/23388/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/23388/comments","events_url":"https://api.github.com/repos/docker/docker/issues/23388/events","html_url":"https://github.com/docker/docker/issues/23388","id":159288340,"number":23388,"title":"Docker container contact/communicate outside container/host","user":{"login":"thalesfsp","id":750360,"avatar_url":"https://avatars.githubusercontent.com/u/750360?v=3","gravatar_id":"","url":"https://api.github.com/users/thalesfsp","html_url":"https://github.com/thalesfsp","followers_url":"https://api.github.com/users/thalesfsp/followers","following_url":"https://api.github.com/users/thalesfsp/following{/other_user}","gists_url":"https://api.github.com/users/thalesfsp/gists{/gist_id}","starred_url":"https://api.github.com/users/thalesfsp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thalesfsp/subscriptions","organizations_url":"https://api.github.com/users/thalesfsp/orgs","repos_url":"https://api.github.com/users/thalesfsp/repos","events_url":"https://api.github.com/users/thalesfsp/events{/privacy}","received_events_url":"https://api.github.com/users/thalesfsp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/version/1.11","name":"version/1.11","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-08T22:22:19Z","updated_at":"2016-06-08T22:22:19Z","closed_at":null,"body":"Docker version:\r\n\r\n```\r\nClient:\r\n Version:      1.11.1\r\n API version:  1.23\r\n Go version:   go1.5.4\r\n Git commit:   5604cbe\r\n Built:        Wed Apr 27 00:34:20 2016\r\n OS/Arch:      darwin/amd64\r\n\r\nServer:\r\n Version:      1.11.1\r\n API version:  1.23\r\n Go version:   go1.5.4\r\n Git commit:   8b63c77\r\n Built:        Fri Jun  3 08:34:52 2016\r\n OS/Arch:      linux/amd64\r\n```\r\n\r\nDocker info:\r\n\r\n```\r\nContainers: 1\r\n Running: 0\r\n Paused: 0\r\n Stopped: 1\r\nImages: 63\r\nServer Version: 1.11.1\r\nStorage Driver: aufs\r\n Root Dir: /var/lib/docker/aufs\r\n Backing Filesystem: extfs\r\n Dirs: 42\r\n Dirperm1 Supported: true\r\nLogging Driver: json-file\r\nCgroup Driver: cgroupfs\r\nPlugins:\r\n Volume: local\r\n Network: bridge null host\r\nKernel Version: 4.4.11-moby\r\nOperating System: Alpine Linux v3.3\r\nOSType: linux\r\nArchitecture: x86_64\r\nCPUs: 6\r\nTotal Memory: 3.857 GiB\r\nName: moby\r\nID: 5A2Z:3A6X:6NR5:7EH4:QSRM:4VTU:LX4A:IKDU:S7ZJ:S267:TCI3:2M3W\r\nDocker Root Dir: /var/lib/docker\r\nDebug mode (client): false\r\nDebug mode (server): true\r\n File Descriptors: 16\r\n Goroutines: 40\r\n System Time: 2016-06-08T22:18:19.350202838Z\r\n EventsListeners: 1\r\nUsername: retsly\r\nRegistry: https://index.docker.io/v1/\r\n```\r\n\r\n## Overview\r\n\r\nI cannot curl a service running in host, for example an ExpressJS application listening in the port `3001`, from inside the container:\r\n\r\n```\r\nroot@e19fc8e02595:/# curl localhost:3001\r\ncurl: (7) Failed to connect to localhost port 3001: Connection refused\r\n\r\nroot@e19fc8e02595:/# curl 0.0.0.0:3001\r\ncurl: (7) Failed to connect to 0.0.0.0 port 3001: Connection refused\r\n\r\nroot@e19fc8e02595:/# curl 172.25.8.25:3001\r\n{\"status\":200} \r\nroot@e19fc8e02595:/#\r\n```\r\n\r\n_Note: `172.25.8.25` is my WiFi IP._\r\n\r\n## Pinata\r\n\r\n```\r\n$pinata list\r\nThese are advanced configuration settings to customize Docker.app on MacOSX.\r\nYou can set them via pinata set <key> <value> <options>.\r\n\r\n🐳  hostname = docker\r\n   Hostname of the virtual machine endpoint, where container ports will be\r\n   exposed if using nat networking. Access it via 'docker.local'.\r\n\r\n🐳  hypervisor = native (memory=4, ncpu=6)\r\n   The Docker.app includes embedded hypervisors that run the virtual machines\r\n   that power the containers. This setting allows you to control which the\r\n   default one used for Linux is.\r\n\r\n ▸  native: a version of the xhyve hypervisor that uses the MacOSX\r\n              Hypervisor.framework to run container VMs. Parameters:\r\n              memory (VM memory in gigabytes), ncpu (vCPUs)\r\n\r\n\r\n🐳  network = hostnet (docker-ipv4=192.168.65.2, host-ipv4=192.168.65.1)\r\n   Controls how local containers can access the external network via the\r\n   MacOS X host. This includes outbound traffic as well as publishing ports\r\n   for external access to the local containers.\r\n\r\n ▸ hostnet: a mode that helps if you are using a VPN that restricts\r\n              connectivity. Activating this mode will proxy container network\r\n              packets via the Docker.app process as host socket traffic.\r\n              Parameters: docker-ipv4 (docker node), host-ipv4 (host node)\r\n ▸     nat: a mode that uses the MacOS X vmnet.framework to route container\r\n              traffic to the host network via a NAT.\r\n\r\n🐳  filesystem = osxfs\r\n   Controls the mode by which files from the MacOS X host and the container\r\n   filesystem are shared with each other.\r\n\r\n ▸   osxfs: a FUSE-based filesystem that bidirectionally forwards OSX\r\n              filesystem events into the container.\r\n\r\n\r\n🐳  native/port-forwarding = true\r\n   Expose container ports on the Mac, rather than the VM\r\n\r\n ▸    true: Container ports will be exposed on the Mac\r\n ▸   false: Container ports will be exposed on the VM\r\n\r\n🐳  daemon = run 'pinata get daemon' or 'pinata set daemon [@file|-]>\r\n   JSON configuration of the local Docker daemon. Configure any custom\r\n   options you need as documented in:\r\n   https://docs.docker.com/engine/reference/commandline/daemon/. Set it\r\n   directly, or a @file or - for stdin.\r\n```\r\n\r\n## Possible duplicates, references, help\r\n\r\n- https://forums.docker.com/t/beta-9-and-localhost-connection-via-net-host/10471\r\n- https://forums.docker.com/t/docker-for-mac-beta-9-and-daemon-options/10449/9\r\n- http://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach\r\n- http://stackoverflow.com/questions/29598504/how-to-connect-to-service-in-the-host-machine-from-inside-a-docker-container\r\n- http://blog.michaelhamrah.com/2014/06/accessing-the-docker-host-server-within-a-container/"}}
{"actor":{"display_login":"thalesfsp"}}