docker stack ps names not always fully qualified
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
Description
docker stack ps <stackname> and docker ps name outputs are different, namely the fully qualified name is a concatenation of docker stack ps output of format {{.Name}}.{{.ID}} (and sometimes isn't). This inconsistency breaks tooling like docker wait expecting the full name.
This could be looked at several ways... Maybe this is a wontfix and the only workaround is to use the {{.Name}}.{{.ID}} format - if so it should at least be documented/consistent. Maybe docker wait should handle IDs as well as names. etc. etc. Maybe docker stack rm should have a --wait parameter. Or docker stack wait.
Migrating issue from https://github.com/docker/for-mac/issues/2671.
Steps to reproduce the issue:
- Create a docker stack
- Run
docker ps - Run
docker stack ps <stackname>
Describe the results you received:
bash-3.2$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
df39135ebb6e arangodb/arangodb:3.3.3 "/entrypoint.sh aran…" 6 seconds ago Up 1 second 8529/tcp tdm_dbms.1.ksgwxqovnte08ztelv5e7wncr
bash-3.2$ docker stack ps tdm
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
ne974rrd1x6g tdm_etl.up0g4yhadxlkc6kbrjf41mxy1 tdm_etl:latest linuxkit-025000000001 Running Running 6 seconds ago
ksgwxqovnte0 tdm_dbms.1 arangodb/arangodb:3.3.3 linuxkit-025000000001 Running Running 7 seconds ago
bash-3.2$ docker wait $(docker stack ps --no-trunc --format "{{.Name}}.{{.ID}}" tdm)
...
Describe the results you expected:
bash-3.2$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
df39135ebb6e arangodb/arangodb:3.3.3 "/entrypoint.sh aran…" 6 seconds ago Up 1 second 8529/tcp tdm_dbms.1.ksgwxqovnte08ztelv5e7wncr
bash-3.2$ docker stack ps tdm
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
ne974rrd1x6g tdm_etl.up0g4yhadxlkc6kbrjf41mxy1 tdm_etl:latest linuxkit-025000000001 Running Running 6 seconds ago
ksgwxqovnte0 tdm_dbms.1.ksgwxqovnte08ztelv5e7wncr arangodb/arangodb:3.3.3 linuxkit-025000000001 Running Running 7 seconds ago
bash-3.2$ docker wait $(docker stack ps --format "{{.Name}}" tdm)
...
Additional information you deem important (e.g. issue happens only occasionally):
Haven't completely validated the docker wait methodology exposed above - looks like sometimes docker stack ps outputs the full name sometimes and a truncated name other times.
Output of docker version:
bash-3.2$ docker version
Client:
Version: 17.12.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:03:51 2017
OS/Arch: darwin/amd64
Server:
Engine:
Version: 17.12.0-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:12:29 2017
OS/Arch: linux/amd64
Experimental: true
Output of docker info:
bash-3.2$ docker info
Containers: 31
Running: 0
Paused: 0
Stopped: 31
Images: 205
Server Version: 17.12.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active
NodeID: up0g4yhadxlkc6kbrjf41mxy1
Is Manager: true
ClusterID: cx8l2pivd9rcpuwt55al326wy
Managers: 1
Nodes: 1
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 3
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Force Rotate: 0
Autolock Managers: false
Root Rotation In Progress: false
Node Address: 192.168.65.3
Manager Addresses:
192.168.65.3:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 89623f28b87a6004d4b785663257362d1658a729
runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.60-linuxkit-aufs
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.952GiB
Name: linuxkit-025000000001
ID: B4QV:JIRY:Y224:6B4S:QQET:NPOJ:CUOK:DUR3:TIXO:CXJU:YQBC:Z4TB
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 36
Goroutines: 150
System Time: 2018-03-07T19:08:41.697781Z
EventsListeners: 2
HTTP Proxy: docker.for.mac.http.internal:3128
HTTPS Proxy: docker.for.mac.http.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Additional environment details (AWS, VirtualBox, physical, etc.):
Physical, Laptop, Docker for Mac
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files or tests are named. Start by reproducing the discrepancy with docker ps, docker stack ps, and the shown format commands, then trace the stack task name output and related CLI tests; done requires an agreed, consistent behavior or documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100