docker stack ps and docker ps names inconsistent after docker stack rm
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> immediately loses the name references after issuing docker stack rm <stackname>. docker ps output still has the names. This inconsistency breaks docker wait $(docker stack ps --no-trunc --format "{{.Name}}.{{.ID}}" <stackname>) functionality.
Migrating issue from https://github.com/docker/for-mac/issues/2672
Steps to reproduce the issue:
- Create docker stack.
- Run
docker stack rm <stackname> && docker ps && docker stack ps <stackname>and inspect output.
Describe the results you received:
bash-3.2$ docker stack rm tdm && docker ps && docker stack ps tdm
Removing service tdm_dbms
Removing service tdm_etl
Removing network tdm_backend
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8462a8d91706 tdm_etl:latest "pipenv run python m…" 11 seconds ago Up 7 seconds tdm_etl.up0g4yhadxlkc6kbrjf41mxy1.65t2lufgp76rmbzakh3kqtxjn
0875ee5278ba arangodb/arangodb:3.3.3 "/entrypoint.sh aran…" 14 seconds ago Up 9 seconds 8529/tcp tdm_dbms.1.15temwzu948jscb0lc8wkc8kc
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
65t2lufgp76r mqccmjlx49ffe16ze20srmcvf.up0g4yhadxlkc6kbrjf41mxy1 tdm_etl:latest linuxkit-025000000001 Remove Running 9 seconds ago
15temwzu948j lowa408eli2eiqwk2x35870ud.1 arangodb/arangodb:3.3.3 linuxkit-025000000001 Remove Running 11 seconds ago
# Pulled from an earlier command, just demonstrating output
bash-3.2$ docker wait $(docker stack ps --no-trunc --format "{{.Name}}.{{.ID}}" tdm)
Error response from daemon: No such container: 2nd4uhp3ey78mxhl3vm706687.up0g4yhadxlkc6kbrjf41mxy1.mcn9f69ft9pw52613h8g2x749
Error response from daemon: No such container: zgixm0rf01mx9fkveg0qdfxwv.1.akzc8h2dz30edtyfhkvya3vm9
Describe the results you expected:
bash-3.2$ docker stack rm tdm && docker ps && docker stack ps tdm
Removing service tdm_dbms
Removing service tdm_etl
Removing network tdm_backend
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8462a8d91706 tdm_etl:latest "pipenv run python m…" 11 seconds ago Up 7 seconds tdm_etl.up0g4yhadxlkc6kbrjf41mxy1.65t2lufgp76rmbzakh3kqtxjn
0875ee5278ba arangodb/arangodb:3.3.3 "/entrypoint.sh aran…" 14 seconds ago Up 9 seconds 8529/tcp tdm_dbms.1.15temwzu948jscb0lc8wkc8kc
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
65t2lufgp76r tdm_etl.up0g4yhadxlkc6kbrjf41mxy1.65t2lufgp76rmbzakh3kqtxjn tdm_etl:latest linuxkit-025000000001 Remove Running 9 seconds ago
15temwzu948j tdm_dbms.1.15temwzu948jscb0lc8wkc8kc arangodb/arangodb:3.3.3 linuxkit-025000000001 Remove Running 11 seconds ago
bash-3.2$ docker wait $(docker stack ps --no-trunc --format "{{.Name}}.{{.ID}}" 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, 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
Start by reproducing the reported sequence with docker stack rm, docker ps, and docker stack ps --no-trunc --format "{{.Name}}.{{.ID}}". Compare the names returned by both commands after removal; done means docker stack ps preserves the full container names so the resulting values can be passed to docker wait.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100