Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetworkSettings are incorrect/unusable when binding on specific IPs #4541

Closed
2 tasks done
lindycoder opened this issue May 11, 2020 · 22 comments
Closed
2 tasks done

NetworkSettings are incorrect/unusable when binding on specific IPs #4541

lindycoder opened this issue May 11, 2020 · 22 comments

Comments

@lindycoder
Copy link

When I try to bind on a specific IP, the network settings shows a host/port that are unusable
I really need to be able to rely on the NetworkSettings

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: 1C24239E-46FE-482F-9659-C5F6D83DF8D1/20200511140922

Expected behavior

See the actual published IP and Port in docker ps and the NetworkSettings.Ports

Actual behavior

I see localhost:32XXX which i cannot connect to

Information

} ~$ docker run -d -p 192.168.0.45:8080:80 httpd
c1d30f70faa02af1b44b35047c103998876e9737b4e69ed1eb552e2ac2631585
} ~$ docker ps
CONTAINER ID        IMAGE               COMMAND              CREATED             STATUS              PORTS                     NAMES
c1d30f70faa0        httpd               "httpd-foreground"   8 seconds ago       Up 7 seconds        127.0.0.1:32775->80/tcp   relaxed_gates

192.168.0.45 is my IP Address.

After starting this container, connecting to 192.168.0.45:8080 DOES work, why does my docker ps shows 127.0.0.1:32775 which doesn't work ?

} ~$ curl 192.168.0.45:8080
<html><body><h1>It works!</h1></body></html>
} ~$ curl 127.0.0.1:32775
curl: (7) Failed to connect to 127.0.0.1 port 32775: Connection refused

Full output of docker inspect

[
    {
        "Id": "c1d30f70faa02af1b44b35047c103998876e9737b4e69ed1eb552e2ac2631585",
        "Created": "2020-05-11T14:10:59.94329638Z",
        "Path": "httpd-foreground",
        "Args": [],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 3961,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2020-05-11T14:11:00.229196718Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:b2c2ab6dcf2e526597d0a5fc506f123088e6572a8a656f04cea86d4f559c66e9",
        "ResolvConfPath": "/var/lib/docker/containers/c1d30f70faa02af1b44b35047c103998876e9737b4e69ed1eb552e2ac2631585/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/c1d30f70faa02af1b44b35047c103998876e9737b4e69ed1eb552e2ac2631585/hostname",
        "HostsPath": "/var/lib/docker/containers/c1d30f70faa02af1b44b35047c103998876e9737b4e69ed1eb552e2ac2631585/hosts",
        "LogPath": "/var/lib/docker/containers/c1d30f70faa02af1b44b35047c103998876e9737b4e69ed1eb552e2ac2631585/c1d30f70faa02af1b44b35047c103998876e9737b4e69ed1eb552e2ac2631585-json.log",
        "Name": "/relaxed_gates",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": null,
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "default",
            "PortBindings": {
                "80/tcp": [
                    {
                        "HostIp": "127.0.0.1",
                        "HostPort": ""
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Capabilities": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": [],
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/656ea21f027afece207cf69c92d4ce19541255bd3065223e4f51539f94d2b2d6-init/diff:/var/lib/docker/overlay2/831b3be7a40fee19c5fc9374bdcb1a2e9a20012357ff217710b1797515122828/diff:/var/lib/docker/overlay2/0c5a043e74a621b7a715b9dc7b67bbee9fbde4aa6b3fc8326d20c480736f93cf/diff:/var/lib/docker/overlay2/04c011b281f006fc856d2db5ca2770738936e6e103614e9d93870c3ebf8e70fd/diff:/var/lib/docker/overlay2/1bb5a8311136470c0dc87507c3af55ea1bd50eee15d04d9b6c858e9ce59b64bc/diff:/var/lib/docker/overlay2/f8fcea4c74b4253882945d72b288dce56c1bac3f3e7569c9fe8e5763adf41d02/diff",
                "MergedDir": "/var/lib/docker/overlay2/656ea21f027afece207cf69c92d4ce19541255bd3065223e4f51539f94d2b2d6/merged",
                "UpperDir": "/var/lib/docker/overlay2/656ea21f027afece207cf69c92d4ce19541255bd3065223e4f51539f94d2b2d6/diff",
                "WorkDir": "/var/lib/docker/overlay2/656ea21f027afece207cf69c92d4ce19541255bd3065223e4f51539f94d2b2d6/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [],
        "Config": {
            "Hostname": "c1d30f70faa0",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/apache2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "HTTPD_PREFIX=/usr/local/apache2",
                "HTTPD_VERSION=2.4.43",
                "HTTPD_SHA256=a497652ab3fc81318cdc2a203090a999150d86461acff97c1065dc910fe10f43",
                "HTTPD_PATCHES="
            ],
            "Cmd": [
                "httpd-foreground"
            ],
            "Image": "httpd",
            "Volumes": null,
            "WorkingDir": "/usr/local/apache2",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {
                "desktop.docker.io/ports/80/tcp": "192.168.0.45:8080"
            },
            "StopSignal": "SIGWINCH"
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "31cc4e6e5b7d903cf4939ce694ce0df1f0cf26e6f37822739ec96805ea745eff",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "80/tcp": [
                    {
                        "HostIp": "127.0.0.1",
                        "HostPort": "32775"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/31cc4e6e5b7d",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "a76eddd58a8bc419fa19dc1f363dce9c60a91c1d99cd0b04a68eddee709dd67c",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:02",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "0599bd0119db0891d28bb8785903c09f8df8b6823e158ec68175331b9641ca95",
                    "EndpointID": "a76eddd58a8bc419fa19dc1f363dce9c60a91c1d99cd0b04a68eddee709dd67c",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02",
                    "DriverOpts": null
                }
            }
        }
    }
]
  • macOS Version: 10.14.6
Docker for Mac: 2.3.0.2 (45183)

Steps to reproduce the behavior

  1. docker run -d -p :8080:80 httpd
  2. docker ps
@thaJeztah
Copy link
Member

When running Docker Desktop, the actual daemon (and containers) are running in a lightweight VM; I think in this case there's some "magic" in Docker Desktop that captures your 192.168.0.45 IP-address, changes it to 127.0.0.1 (which would be the IP-address the container itself is listening on inside the VM), and sets up a proxy to forward requests on 192.168.0.45 to the container inside the VM. (@djs55 could fill me in on that one)

That said, if your intent is to make the port accessible on your machine's IP-address, you can omit the IP-address (-p 8080:80), which will make the container accessible both on localhost:8080 (from your machine) and on your machine's IP address (192.168.0.45:8080)

@lindycoder
Copy link
Author

lindycoder commented May 11, 2020

Yes I do understand the mechanics here, but we have tools relying on the data in network settings and those are breaking now.

This all used to work very well in 2.1.0.5, the last version before assigning to specific IPs started failing (see #4209 ). So i downgraded.

I can see the 'intended" mapping in Config.Labels.

Looks like a regression to me

@lindycoder
Copy link
Author

This comment reports magic happening at client side, might be part of the issue

#4209 (comment)

@thaJeztah
Copy link
Member

I think these changes are in the proxy that's used to map the docker socket inside the VM to the host. When bind-mounting the docker socket in a container (-v /var/run/docker.sock:/var/run/docker.sock), the raw proxy is bind-mounted, without the proxy in between (skipping any rewriting that the proxy would do)

@tecnobrat
Copy link

@thaJeztah do you happen to have any information about where the code for that proxy is? Looks like it may be some private repo?

I wonder if I can access the proxy from within docker (instead of using the docker socket)

@thaJeztah
Copy link
Member

That proxy is part of the proprietary code in Docker Desktop, so cant link to the code itself. If you connect to the docker socket on your host machine (mac/win) that docker is proxied.

(disclaimer: I'm not on the Docker Desktop team, so don't have answers to all the nitty-gritty details 😅🤗)

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@lmakarov
Copy link

/remove-lifecycle stale

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@lindycoder
Copy link
Author

/remove-lifecycle stale

@lindycoder
Copy link
Author

/lifecycle frozen

@lindycoder
Copy link
Author

lindycoder commented Dec 18, 2020

Update:

The problem is still there, and the Config.labels have disappeared, so there doesn't seem to be anyway of getting my port mapping after my docker run

Reproducing, using my local IP (10.0.0.106):

} ~/work$ docker run -d -p 10.0.0.106:8080:80 httpd
a739d925a7d8ce2a3885abcf8478d528193ad751de05927c5dd15e325189283f

Mapping works very well.

} ~/work$ curl -i 10.0.0.106:8080
HTTP/1.1 200 OK
Date: Fri, 18 Dec 2020 19:12:32 GMT
Server: Apache/2.4.46 (Unix)
Last-Modified: Mon, 11 Jun 2007 18:53:14 GMT
ETag: "2d-432a5e4a73a80"
Accept-Ranges: bytes
Content-Length: 45
Content-Type: text/html

<html><body><h1>It works!</h1></body></html>

docker ps still not showing the right mapping

} ~/work$ docker ps -a
CONTAINER ID   IMAGE     COMMAND              CREATED          STATUS          PORTS                     NAMES
a739d925a7d8   httpd     "httpd-foreground"   48 seconds ago   Up 48 seconds   127.0.0.1:55005->80/tcp   nice_varahamihira

Docker inspect has no more label i could use to find the mapping, and nothing mentions "8080" in there

[
    {
        "Id": "a739d925a7d8ce2a3885abcf8478d528193ad751de05927c5dd15e325189283f",
        "Created": "2020-12-18T19:07:13.034533461Z",
        "Path": "httpd-foreground",
        "Args": [],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 3705,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2020-12-18T19:07:13.406373373Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:dd85cdbb99877b73f0de2053f225af590ab188d79469eebdb23ec2d26d0d10e8",
        "ResolvConfPath": "/var/lib/docker/containers/a739d925a7d8ce2a3885abcf8478d528193ad751de05927c5dd15e325189283f/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/a739d925a7d8ce2a3885abcf8478d528193ad751de05927c5dd15e325189283f/hostname",
        "HostsPath": "/var/lib/docker/containers/a739d925a7d8ce2a3885abcf8478d528193ad751de05927c5dd15e325189283f/hosts",
        "LogPath": "/var/lib/docker/containers/a739d925a7d8ce2a3885abcf8478d528193ad751de05927c5dd15e325189283f/a739d925a7d8ce2a3885abcf8478d528193ad751de05927c5dd15e325189283f-json.log",
        "Name": "/nice_varahamihira",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": null,
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "default",
            "PortBindings": {
                "80/tcp": [
                    {
                        "HostIp": "127.0.0.1",
                        "HostPort": ""
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Capabilities": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": [],
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/63bfe4038751db6aab5d8f1e85fe511cee31acf78d9a19530619714c2d67fddd-init/diff:/var/lib/docker/overlay2/c90acc9aeb4ade318d8b0ea962def9d68cd368ad2b8a4a567ecb5f118aa991b8/diff:/var/lib/docker/overlay2/1a584bbde6ebba8d9718c27ff4cbbe7ece39d1b52c0fa0035fea7b0e0196da29/diff:/var/lib/docker/overlay2/dc36985d4505dd0758c6ef2fb6e0015fec8813c7a2a7246e2084bb96aaa09ea6/diff:/var/lib/docker/overlay2/dd0c532ce35d9bdcc09a1375b52268d355b6bf6e1d1025fd21f028d1724e31ba/diff:/var/lib/docker/overlay2/0cfa4734d17100fd1a9b1b970ba5c14ddfe40e9f5a6de265224c0d9d81a6a189/diff",
                "MergedDir": "/var/lib/docker/overlay2/63bfe4038751db6aab5d8f1e85fe511cee31acf78d9a19530619714c2d67fddd/merged",
                "UpperDir": "/var/lib/docker/overlay2/63bfe4038751db6aab5d8f1e85fe511cee31acf78d9a19530619714c2d67fddd/diff",
                "WorkDir": "/var/lib/docker/overlay2/63bfe4038751db6aab5d8f1e85fe511cee31acf78d9a19530619714c2d67fddd/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [],
        "Config": {
            "Hostname": "a739d925a7d8",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/apache2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "HTTPD_PREFIX=/usr/local/apache2",
                "HTTPD_VERSION=2.4.46",
                "HTTPD_SHA256=740eddf6e1c641992b22359cabc66e6325868c3c5e2e3f98faf349b61ecf41ea",
                "HTTPD_PATCHES="
            ],
            "Cmd": [
                "httpd-foreground"
            ],
            "Image": "httpd",
            "Volumes": null,
            "WorkingDir": "/usr/local/apache2",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {},
            "StopSignal": "SIGWINCH"
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "e26c690856d30e0719f5ea5c4d22c117fc7ab0439f6a13417338fee8377c96a3",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "80/tcp": [
                    {
                        "HostIp": "127.0.0.1",
                        "HostPort": "55005"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/e26c690856d3",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "9a9e238696490512a0c5ab29fddb2ce649d6e951d40d19fae7c6118c15185d54",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:02",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "979c8bbaf78622095236af7824ae93af6a574ec8993a1a0ff576495920b257c6",
                    "EndpointID": "9a9e238696490512a0c5ab29fddb2ce649d6e951d40d19fae7c6118c15185d54",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02",
                    "DriverOpts": null
                }
            }
        }
    }
]

Even the new Docker dashboard has no idea what's happening.

Screen Shot 2020-12-18 at 14 08 37

If there was something to link back what I docker run it would be very helpful.

Thank you!

@lindycoder
Copy link
Author

Just found out the labels are available in the /containers call of the docker api... but not the /containers/

} ~/work$ docker run -d -p 10.0.0.106:49834:80 --name port-test httpd
7df2db377b99104e091696fe2c27d07db623742aa86803c7b5e316d325686e4e
} ~/work$ curl -s --unix-socket /var/run/docker.sock http://localhost/v1.41/containers/json | jq
[
  {
    "Id": "7df2db377b99104e091696fe2c27d07db623742aa86803c7b5e316d325686e4e",
    "Names": [
      "/port-test"
    ],
    "Image": "httpd",
    "ImageID": "sha256:dd85cdbb99877b73f0de2053f225af590ab188d79469eebdb23ec2d26d0d10e8",
    "Command": "httpd-foreground",
    "Created": 1608326488,
    "Ports": [
      {
        "IP": "127.0.0.1",
        "PrivatePort": 80,
        "PublicPort": 55005,
        "Type": "tcp"
      }
    ],
    "Labels": {
      "desktop.docker.io/ports/80/tcp": "10.0.0.106:49834"
    },
    "State": "running",
    "Status": "Up 14 seconds",
    "HostConfig": {
      "NetworkMode": "default"
    },
    "NetworkSettings": {
      "Networks": {
        "bridge": {
          "IPAMConfig": null,
          "Links": null,
          "Aliases": null,
          "NetworkID": "08e5211ac43b6239a4a70fb26589fb1ad490ed8b5824d36da46543389650d833",
          "EndpointID": "1f27529b312013ca3da4de6384b7e6739bc75d67f461c70f72198a9d16b546d2",
          "Gateway": "172.17.0.1",
          "IPAddress": "172.17.0.2",
          "IPPrefixLen": 16,
          "IPv6Gateway": "",
          "GlobalIPv6Address": "",
          "GlobalIPv6PrefixLen": 0,
          "MacAddress": "02:42:ac:11:00:02",
          "DriverOpts": null
        }
      }
    },
    "Mounts": []
  }
]

@simonferquel
Copy link

Hi, we have a preview build that should fix this issue here: https://desktop.docker.com/mac/preview/60183/Docker.dmg.

@rfay
Copy link

rfay commented Jan 25, 2021

Thanks for your work on that!

@lindycoder
Copy link
Author

I confirm this preview build solves this issue 🎉 🎉 🎉 🎉 !

Do you know which version this will make it in?

@mat007
Copy link
Member

mat007 commented Jan 29, 2021

@lindycoder in the next version 😁
We’re not sure quite when yet, though.

@lindycoder
Copy link
Author

Thank you very much!

carolynvs added a commit to carolynvs/porter-operator that referenced this issue Feb 16, 2021
Have the test cluster listen on a real ip instead of localhost so that
porter can run on it and connect to the cluster.

This relies on a preview build of docker for mac which should be
released shortly.
docker/for-mac#4541 (comment)

Signed-off-by: Carolyn Van Slyck <[email protected]>
@castamir
Copy link

castamir commented Mar 3, 2021

I think that this upgrade broke our stack:

[
    {
        "Id": "af8deccf3c3e7122d79c7316b7db406e22435c18c17dd1c7a336347f566d7ab0",
        "Created": "2021-03-03T13:40:33.916923616Z",
        "Path": "webproc",
        "Args": [
            "--config",
            "/etc/dnsmasq.conf",
            "--",
            "dnsmasq",
            "--no-daemon",
            "--address=/lvh.me/192.168.65.2"
        ],
        "State": {
            "Status": "created",
            "Running": false,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 0,
            "ExitCode": 128,
            "Error": "driver failed programming external connectivity on endpoint app_dnsmasq_1 (5a04be50ea6e677854915f381d597ff5688da3428897ad17723a9ec593b4aa4c): Error starting userland proxy: listen udp4 0.0.0.0:53: bind: address already in use",
            "StartedAt": "0001-01-01T00:00:00Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:2ccfbd72b37814a30a99ba7c122d1ae8ba4fcd31aecbb72b81632260f2d78723",
        "ResolvConfPath": "/var/lib/docker/containers/af8deccf3c3e7122d79c7316b7db406e22435c18c17dd1c7a336347f566d7ab0/resolv.conf",
        "HostnamePath": "",
        "HostsPath": "/var/lib/docker/containers/af8deccf3c3e7122d79c7316b7db406e22435c18c17dd1c7a336347f566d7ab0/hosts",
        "LogPath": "",
        "Name": "/app_dnsmasq_1",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/<path>/dnsmasq/dnsmasq.conf:/etc/dnsmasq.conf:ro"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "cmg_local_docker",
            "PortBindings": {
                "53/udp": [
                    {
                        "HostIp": "",
                        "HostPort": "53"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": [],
            "CapAdd": null,
            "CapDrop": null,
            "CgroupnsMode": "host",
            "Dns": null,
            "DnsOptions": null,
            "DnsSearch": null,
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/d28f08e945dcc39ce8a855c5a3f83ff25d45f9bb459d0350de477271774c5001-init/diff:/var/lib/docker/overlay2/0e7d49873db26ef1472e4b666f6ba4123164b26ddee9b8182c0065ac9ccc3d58/diff:/var/lib/docker/overlay2/7c7ea2d3a97c54bdf67179be29e1dd094748c61e2755e8060109909fbe287ce2/diff:/var/lib/docker/overlay2/6171f6912686334b28fffb22fb59680e6cb5d4457a7111cb7aaa60b0a7d8f6ec/diff:/var/lib/docker/overlay2/da19e8559216afa4ffb35046a02c77fc6466993101dcec913a1d73e2fa6fbea4/diff:/var/lib/docker/overlay2/129df02b564c30eb6f1e72dc1e2361a732efa5912ac72abe0bc03353580bcd62/diff",
                "MergedDir": "/var/lib/docker/overlay2/d28f08e945dcc39ce8a855c5a3f83ff25d45f9bb459d0350de477271774c5001/merged",
                "UpperDir": "/var/lib/docker/overlay2/d28f08e945dcc39ce8a855c5a3f83ff25d45f9bb459d0350de477271774c5001/diff",
                "WorkDir": "/var/lib/docker/overlay2/d28f08e945dcc39ce8a855c5a3f83ff25d45f9bb459d0350de477271774c5001/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/Users/mirapaulik/cmg/local-docker/dnsmasq/dnsmasq.conf",
                "Destination": "/etc/dnsmasq.conf",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "af8deccf3c3e",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "53/udp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "WEBPROC_VERSION=0.2.2",
                "WEBPROC_URL=https://github.com/jpillora/webproc/releases/download/0.2.2/webproc_linux_amd64.gz"
            ],
            "Cmd": [
                "--address=/lvh.me/192.168.65.2"
            ],
            "Image": "jpillora/dnsmasq:latest",
            "Volumes": {
                "/etc/dnsmasq.conf": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "webproc",
                "--config",
                "/etc/dnsmasq.conf",
                "--",
                "dnsmasq",
                "--no-daemon"
            ],
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "1b9e53c1cf0a8a751025806ffbc0a733a726b889ff90f809d526b6210a5b0256",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "app",
                "com.docker.compose.project.config_files": "dc.dnsmasq.yaml,dc.eventhub.yaml,dc.nginxproxy.yaml,dc.rabbitmq.yaml,dc.identity.yaml,dc.rolodex.yaml,dc.datalab.yaml,dc.datalabgateway.yaml,dc.offeringsetup.yaml,dc.orderbook.yaml,dc.roadshows.yaml,dc.wires.yaml,dc.identityclient.yaml",
                "com.docker.compose.project.working_dir": "/Users/mirapaulik/cmg/local-docker",
                "com.docker.compose.service": "dnsmasq",
                "com.docker.compose.version": "1.28.5",
                "maintainer": "[email protected]"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "87cdaecfb06cd99578a68a3a3b5a8e875140ba1126e7e89755db94be5666d93e",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/87cdaecfb06c",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "cmg_local_docker": {
                    "IPAMConfig": {
                        "IPv4Address": "172.28.8.8"
                    },
                    "Links": null,
                    "Aliases": [
                        "af8deccf3c3e",
                        "dnsmasq"
                    ],
                    "NetworkID": "74a67323cda6334ec2ac7895d58758ea17421a5973e6f8d4e91de37c8c243b01",
                    "EndpointID": "",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "",
                    "DriverOpts": null
                }
            }
        }
    }
]

@stephen-turner
Copy link
Contributor

This is fixed in versions 3.2.0 and 3.2.1. Closing the ticket now.

@castamir
Copy link

@stephen-turner actually, it was introduced by v3.2.0 and fixed in v3.2.2

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Apr 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants