Can not stop Docker Container: permission denied Error

So even when I create a container outside docker-compose and try to stop or kill it it results in the same error. Meaning I can not stop or kill any container.

Using docker inspect I found the PID the container was using. Killing this process as root using kill -9 did not work. Eventually I started consulting the docker service and found the line below in the results of the dmesg command:

[ 5602.621070] audit: type=1400 audit(1510837007.956:60): apparmor=“DENIED” operation=“signal” profile=“docker-default” pid=20728 comm=“docker-containe” requested_mask=“receive” denied_mask=“receive” signal=kill peer=“unconfined”

After using the below commands I was able to use docker-compose stop again.

:warning: Moderator notice

Several people complained that the following removed many more applications than they wanted. Do not execute the command if you don’t know what it will do, and always read all follow up posts.

sudo apt-get purge --auto-remove apparmor

sudo service docker restart
docker system prune --all --volumes

6 Likes