A discussion on the issues caused by Ubuntu updates interfering with Docker and AUFS. downey encountered an error when trying to destroy a container, and sam suggested that device mapper is not supported and AUFS needs to be used instead.
To recover from the issue, riking provided steps to manually remove leftover containers and images using docker rm/rmi. renoirb suggested ensuring that linux-image-extra-virtual and aufs-tools are installed, and adding DOCKER_OPTS="-s aufs" to /etc/default/docker.
codinghorror mentioned that updating Docker every few months might prevent the issue, and eschipul provided a solution to install linux-image-extra-$(uname -r) aufs-tools after a kernel upgrade.
The discussion concluded that installing linux-image-extra-virtual and ensuring AUFS is used can prevent the issue, and riking suggested adding this to the install docs.
This was going fine for me until the last moment, when I got the following super-useful error message:
Error response from daemon: Cannot destroy container 1cd705ffc49f5ce0622614316e3a742b8e6c8a77362528338db30a6f352477d2: Driver devicemapper failed to remove root filesystem 1cd705ffc49f5ce0622614316e3a742b8e6c8a77362528338db30a6f352477d2: Device is Busy
FATA[0014] Error: failed to remove one or more containers
Invalid cid file, deleting, please re-run
How to recover?
How to make this more reliable and easier for users/admins?
I have no idea what either of those are. I only followed the official directions for the docker installation, and the only changes we’ve made were to add SSL & adding a few plugins.
Just using apt-get upgrade and upgrading all packages every few weeks. As mentioned in the other thread, it’s hard to say when aufs went away, it was surely in a kernel upgrade at some point, and then this is likely the first docker image upgrade since then.
Yes, I had to follow the same steps as @danwad. I imagine we won’t be the only ones so I’m glad this is documented.
I haven’t noticed this problem lately but not sure when the last updates were run on the server. Will keep an eye on it and remember to come back here if we see any more problems.
Disappearing Dockers on Ubuntu after updates only happens when the kernel is upgraded. While your solution worked this time, it might not the next time given you had just done an update previously. This is the line you want to run specifically after a kernel upgrade.
Then you do have to reboot unfortunately. It happens on our Ubuntu servers all of the time. Worst case scenario it doesn’t find an update and just jumps past the line. Perhaps not perfect but effective and fast. I hope this helps!