9

On running docker-compose stop it fails to stop the docker images, and gives an error like this:

ERROR: for nginx cannot stop container: 5f5ed6d2110a0d845508ede160d8196d3e01f1d677e22e4944adc8c984800cff: Cannot kill container 5f5ed6d2110a0d845508ede160d8196d3e01f1d677e22e4944adc8c984800cff: Unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:393: signaling init process caused "Permission Denied": unknown

The images are still running properly, they just don't restart. I am running docker-compose on Ubuntu.

Benyamin Jafari
  • 15,536
  • 14
  • 81
  • 116
Rijo Simon
  • 679
  • 2
  • 12
  • 28

2 Answers2

13

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.

Eddy R.
  • 939
  • 6
  • 12
  • 8
    I think it's now `containerd-shim`, at least in my version. – serkef Dec 26 '18 at 11:35
  • Also check https://stackoverflow.com/questions/49104733/docker-on-ubuntu-16-04-error-when-killing-container/49573618#49573618. Eddy's solution worked for me in 18.10 as well. snap remove docker. – serkef Dec 28 '18 at 21:20
12

Somehow this worked for me.

$ sudo killall containerd-shim
Zoe
  • 23,712
  • 16
  • 99
  • 132
Myster-Mayur
  • 362
  • 2
  • 8