dockerode icon indicating copy to clipboard operation
dockerode copied to clipboard

Dockerode not opening up two ports

Open bwship opened this issue 4 years ago • 2 comments

When I attempt to have a second port in the create options, it correctly creates the first, but not the second port.

{ "createOptions": { "Env": [ "DATA_DIR=/tmp/localstack/data", "DOCKER_HOST=unix:///var/run/docker.sock", "SERVICES=apigateway" ], "Image": "localstack/localstack:0.12.10", "name": "commandeer-localstack-default-local", "ExposedPorts": { "443/tcp:": {} }, "HostConfig": { "PortBindings": { "4566/tcp": [ { "HostPort": "4566" } ], "443/tcp": [ { "HostPort": "443" } ] }, "AutoRemove": true, "Binds": [ "/var/run/docker.sock:/var/run/docker.sock" ] } } }

This should expose 4566 and 443, but when I inspect the newly created container, it has this info.

"NetworkSettings": { "Bridge": "", "SandboxID": "f55fe8aad382e3fb418c419bdee6ad52c2540c160b93d0f7164a5cd8088ea00a", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": { "443/0": null, "4566/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "4566" } ], "4571/tcp": null, "8080/tcp": null },

You can see that 4566 is setup correctly, but 443/0 : null for the 443 port. I have tried this without the ExposedPorts section, changed the order of the HostOptions, etc. But it still never works. Any ideas?

bwship avatar Jul 09 '21 14:07 bwship

same problem

NobleMajo avatar Feb 28 '22 00:02 NobleMajo

Notice the typo - : inside "443/tcp:". Should be:

"ExposedPorts": {
  "443/tcp": {}
}

panayi avatar Jul 06 '22 11:07 panayi

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Open a new issue if needed.

stale[bot] avatar Jan 08 '24 18:01 stale[bot]