You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When specifying only the container port when publishing a port (-p <container-port>), the randomly assigned host-port is not visible in docker service ls, and 0 is shown instead.
Steps to reproduce the issue:
Create two services with a port published; one with a fixed host-port, one with a randomly assigned host-port;
$ docker service create -p 1234:80 --name with-fixed-port nginx:alpine
$ docker service create -p 80 --name with-random-port nginx:alpine
Inspect the service with a randomly assigned host-port;
Description
When specifying only the container port when publishing a port (
-p <container-port>
), the randomly assigned host-port is not visible indocker service ls
, and0
is shown instead.Steps to reproduce the issue:
Create two services with a port published; one with a fixed host-port, one with a randomly assigned host-port;
Inspect the service with a randomly assigned host-port;
Run
docker service ls
Describe the results you received:
The service's "random" host port is (probably) taken from the services
.Endpoint.Spec
, and presented as*:0->80/tcp
Describe the results you expected:
The "random" port should be taken from the service's
Endpoint.Ports
, and presented as*:30000->80/tcp
Additional information you deem important (e.g. issue happens only occasionally):
Always reproducible
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: