On running docker-compose stop
it fails to stop the docker images, and gives an error like this:
ERROR: for nginx cannot stop container: 5f5ed6d2110a0
I was able to work around the problem by running:
sudo killall docker-containerd-shim
And then docker-compose down
started working for me.
I found the solution in this bug report, and it seems that it involves a backport of a fix to the runc code.
EDIT
It seems that the root cause of these problems on my system was the Docker snap image on my Ubuntu 18.04 installation. I completely removed the snap image and reinstalled Docker using https://get.docker.io, and I no longer encounter these problems. In the meantime, the rest of my answer above worked for me as a workaround.
Somehow this worked for me.
$ sudo killall containerd-shim