Skip to content

docker run --rm do not auto clean when container stop after docker daemon restart #20744

@wu0407

Description

@wu0407

If container already running with --rm when restart docker daemon, container will auto stop.
Then restart the stop container and exit it.But the container that running with --rm not auto clean after container stop..

Output of docker version:

[root@centos7-node4 docker-systemd]# docker version
Client:
 Version:      1.10.2
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   c3959b1
 Built:        Mon Feb 22 16:16:33 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.10.2
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   c3959b1
 Built:        Mon Feb 22 16:16:33 2016
 OS/Arch:      linux/amd64

Output of docker info:

[root@centos7-node4 docker-systemd]# docker info
Containers: 3
 Running: 1
 Paused: 0
 Stopped: 2
Images: 31
Server Version: 1.10.2
Storage Driver: devicemapper
 Pool Name: docker-253:1-100931327-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 107.4 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 1.755 GB
 Data Space Total: 107.4 GB
 Data Space Available: 17.55 GB
 Metadata Space Used: 2.38 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.145 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.107-RHEL7 (2015-10-14)
Execution Driver: native-0.2
Logging Driver: json-file
Plugins: 
 Volume: local
 Network: null host bridge
Kernel Version: 3.10.0-229.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 3.703 GiB
Name: centos7-node4
ID: YAFU:XTDB:LHWO:33EQ:DE56:6HY4:R7EI:B2BB:73NO:DXBR:HKID:T4HO
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

Provide additional environment details (AWS, VirtualBox, physical, etc.):

running under KVM.

List the steps to reproduce the issue:

1.start --rm container
     docker run -it --rm centos7-xq-nosystemd:v1.2 --name net1  /bin/bash  
2.restart docker daemon
    systemctl daemon-reload &&  systemctl restart docker.service (now container stoped)
3.restart stoped container
    docker start net1
    docker attach net1
      exit
# docker ps -a      
CONTAINER ID        IMAGE                       COMMAND             CREATED             STATUS                      PORTS               NAMES
24eec1f78d9e        centos7-xq-nosystemd:v1.2   "/bin/bash"         5 hours ago         Up 59 minutes                                   net2
8397c7995192        centos7-xq-nosystemd:v1.2   "/bin/bash"         5 hours ago         Exited (0) 4 seconds ago                        net1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions