#53706·Docker

docker prune cmd cleaned up image tags while it is still being used by a container

Author: kamizjwCreated Sep 17, 2026Updated Sep 17, 2026
Labelskind/bug

Description

When I tag an image and start a container using that tag, executing the prune command removes the tag, resulting in a discrepancy between the information displayed by the ps command before and after the operation.

Reproduce

1.docker tag fd2d3e51789e test2 2.docker run -itd test2:latest bash 3.docker ps 4.docker image prune -a 5.docker ps

Expected behavior

prune cmd should retaining the tagged image currently in use

docker version

Client:
 Version:           29.8.1
 API version:       1.56
 Go version:        go1.26.8
 Git commit:        4a63305
 Built:             Tue Sep 15 16:24:36 2026
 OS/Arch:           linux/arm64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          29.8.1
  API version:      1.56 (minimum version 1.40)
  Go version:       go1.26.8
  Git commit:       464cd50
  Built:            Tue Sep 15 16:25:54 2026
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          v2.3.5
  GitCommit:        1294c24a7da8e5a793ed378161673abe94118892
 runc:
  Version:          1.5.1
  GitCommit:        v1.5.1-0-g8f2685a
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    29.8.1
 Context:    default
 Debug Mode: false

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 1
 Server Version: 29.8.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 1294c24a7da8e5a793ed378161673abe94118892
 runc version: v1.5.1-0-g8f2685a
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 6.6.0-72.0.0.76.h21510.1839.eulerosv2r15.aarch64
 Operating System: EulerOS 2.0 (SP15)
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 7.235GiB
 Name: localhost.localdomain
 ID: cf2ec6a5-f11c-463f-a650-604b35422f72
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 34
  Goroutines: 58
  System Time: 2026-09-17T15:26:11.41188141+08:00
  EventsListeners: 0
 Experimental: false
 Insecure Registries:
  k8s.gcr.io
  10.175.125.206:80
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: true
 Product License: Community Engine
 Firewall Backend: iptables+firewalld
  EnableUserlandProxy: true
  UserlandProxyPath: /usr/bin/docker-proxy

Additional Info

No response