for-aws
for-aws copied to clipboard
docker ps <service> lists tasks for all services starting with service name <service>
Expected behavior
Only tasks for a specific service be listed.
Actual behavior
Tasks for all services starting with the specified service name get listed.
Steps to reproduce the behavior
- ...Create two services (any arbitrary Docker services) with one with suffix -2. For example, two services
mysql
andmysql-2
. - ...The
docker service ps mysql
command lists tasks for both the servicesmysql
andmysql-2
.
~ $ docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
likujs72e46t mysql replicated 3/3 mysql:latest
ocd9sz8qqp2b mysql-2 replicated 3/3 mysql:latest
~ $ docker service ps mysql
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
c2ckhyi0rmry mysql-2.1 mysql:latest ip-172-31-47-15.ec2.internal Running Running 11 minutes ago
v4bn24seygc6 mysql.1 mysql:latest ip-172-31-47-15.ec2.internal Running Running 29 minutes ago
wnr3x7khz9vg mysql-2.2 mysql:latest ip-172-31-47-123.ec2.internal Running Running 7 minutes ago
29702ebj52gs mysql.2 mysql:latest ip-172-31-47-123.ec2.internal Running Running 27 minutes ago
f0112rfzt1cd mysql-2.3 mysql:latest ip-172-31-3-168.ec2.internal Running Running 7 minutes ago
c7b8v16msudl mysql.3 mysql:latest ip-172-31-3-168.ec2.internal Running Running 27 minutes ago
This isn't docker for aws specific, probably best to add this issue to one of the upstream repos, maybe https://github.com/moby/moby is the right place?
It looks like docker service ps
is using a wildcard search. There is probably a way to make it more rigid with it's results. For more info about docker service ps
, including how to best to search and format the output, check out: https://docs.docker.com/engine/reference/commandline/service_ps/
docker service ps
is supposed to be for the specified service. Even enclosing service name in quotes docker service ps "mysql"
lists all tasks for service name starting with "mysql"
Copying here as well; this is a duplicate of https://github.com/moby/moby/issues/32556 and already fixed on master through https://github.com/docker/cli/pull/72 (which will be included in docker 17.06.1)