Can't delete container while rancher agent is running

I have 2 servers:

  • 1st install Ubuntu + Rancher Server
  • 2nd install Ubuntu + Rancher Agent + my app

2nd server is running many container. Sometime, I stop and delete some container to deploy new version of application, and it show error
sudo docker rm -f 4a6acc834b6c
Error response from daemon: Cannot destroy container 4a6acc834b6c: Driver aufs failed to remove root filesystem 4a6acc834b6c82133c885ba97589816ac77e961f7b56bd5bd4cab822309542b6: rename /var/lib/docker/aufs/mnt/4a6acc834b6c82133c885ba97589816ac77e961f7b56bd5bd4cab822309542b6 /var/lib/docker/aufs/mnt/4a6acc834b6c82133c885ba97589816ac77e961f7b56bd5bd4cab822309542b6-removing: device or resource busy
Error: failed to remove containers: [4a6acc834b6c]

If I delete on website of rancher server, it’s ok. Or I must run the following command before I can delelte it:
sudo umount -l $(grep ‘aufs’ /proc/mounts | awk ‘{print$2}’ | sort -r)

Why rancher agent deny deleting container?

This is an old docker issue and not a Rancher/rancher agent issue.

I use docker version 1.8.3

Yep, still an issue with Docker as the issue is open and people are still reporting issues with it on using Docker v0.1.9-rc3.

But why can I delete without error on Rancher’s website?

I still got this problem with

% docker version                                                                                                                                                  !10001
Client:
 Version:      1.10.1
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   9e83765
 Built:        Thu Feb 11 19:27:08 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.10.1
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   9e83765
 Built:        Thu Feb 11 19:27:08 2016
 OS/Arch:      linux/amd64