-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Docker 1.13: docker service/stack ps
cannot show the service/task ports status
#30232
Comments
missing during parse it? |
For the Retested on a pure 1.13 cluster, there are
$ docker service create --name myapp2 --publish mode=host,published=8002,target=80 nginx
$ docker service ps myapp2
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
pobogp37t1ba myapp2.1 nginx:latest d1 Running Running 13 minutes ago *:8002->80/tcp
$ docker service create --name myapp1 -p 8001:80 nginx
$ docker service ps myapp1
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
jd9zik85ymuu myapp1.1 nginx:latest d1 Running Running 26 minutes ago |
This was by design, and the reason for this is that ports for individual tasks are not published in However there was already some discussion about this, because from a UX perspective, it's confusing, so if technically possible, I would not be against presenting this information. We need a design for this (both API, and a presentation that allows users to distinguish between the "publish" modes |
Yes, it's confusing, especially for I understand it's published on service if |
@twang2218 This looks very wrong. We were supposed to show Furthermore, /cc @mavenugo @vieux @thaJeztah I think this should be fixed in |
Still a bit in doubt if |
Description
docker service create --publish
can specify the published port mapping for the service. However, bothdocker service ls
anddocker service ps
cannot show such information.In
1.13
, one more column,PORTS
, was added indocker service ps
result, however, it's always empty.Steps to reproduce the issue:
Update: the below problem was caused by mixing Docker 1.12 and 1.13 in the Swarm cluster, check the comment below about the details
I also tried with
--publish mode=host
which is introduced in1.13
, but still nothing shows onPORTS
column:Describe the results you received:
The
PORTS
section is empty.Describe the results you expected:
There should be something like
80/tcp, 443/tcp
or8001 => 80/tcp, 443/tcp
in the section.And
docker stack ps
inherit the same problem with emptyPORTS
column:root@d1:~/stack-deploy# docker stack ps lnmp -f desired-state=running ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS 1x6qiieam21p lnmp_mysql.1 mysql:5.7 d1 Running Running 31 minutes ago 7irrc6v9xnbo lnmp_nginx.1 twang2218/lnmp-nginx:v1.2 d1 Running Running 31 minutes ago 2bq2kjm6xacn lnmp_php.1 twang2218/lnmp-php:v1.2 d1 Running Running 31 minutes ago edp0ed1k6u9w lnmp_nginx.2 twang2218/lnmp-nginx:v1.2 d1 Running Running 31 minutes ago 1hlmkgtpf1pa lnmp_php.2 twang2218/lnmp-php:v1.2 d2 Running Running 31 minutes ago 0xjjyu3tyewp lnmp_php.3 twang2218/lnmp-php:v1.2 d2 Running Running 31 minutes ago e9lgn25kyepx lnmp_php.4 twang2218/lnmp-php:v1.2 d1 Running Running 31 minutes ago
Additional information you deem important (e.g. issue happens only occasionally):
After dive into the code, I found the code of printing port information is at:
https://github.com/docker/docker/blob/master/cli/command/task/print.go#L142-L154
And I inspect the task to see what's value of
task.Status.PortStatus
:As shown above, it's empty:
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: