Can not stop container

Hi,

I’m new to docker and I have an error while I’m trying to stop a container.

First of all, I use Linux and I do not understand why I always have to use ‘sudo’ to run a simple docker stop web command.

Next, when I type such command as above (e.g. sudo docker stop web) I get an error message:
Error response from daemon: cannot stop container: web: permission denied

why ?
I use sudo and I should work even without sudo command

2022-06-26_docker_containre_not_stoping

Hi :slight_smile:

You need to use sudo, because you want to be in control over who can stop/start containers, and right now, its only root that have permissions since … its root :slight_smile:
BUT, you can give your user access to do this, if you add your user to the group “docker”

Regarding the other question, i belive you have something blocking your user to do it, maybe apparmor.
Can you verify by:

sudo apparmor_status