How to stop a container using ssh connection?

2019-08-16 17:31发布

问题:

I have this error when I try to stop a container with sudo docker stop pg:

Error response from daemon: cannot stop container: pg: Cannot kill container 9cead43f288336d418e91105d5c9a4e0858794c96ebd167e5e92784d8ed1eab2: unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:393: signaling init process caused "permission denied"

回答1:

It seems that apparmor it's blocking the access, you can try stop it and try again to stop the container:

sudo systemctl stop apparmor && systemctl disable apparmor
sudo docker stop pg

And then run it again with the flag:

--security-opt apparmor=unconfined


标签: docker