Error response from daemon: cannot stop container

I'm going to disagree with everyone suggesting sudo. The docker command sends api calls to the daemon, and if you needed sudo to run the command, you would know from the failure to connect to the docker socket. The daemon itself should be running as root.

The permission error to me looks like something that could be caused by an AppArmor policy or it could just be a bug in the engine/containerd/runc. You are also running Ubuntu 18.04 which docker only recently added support, so if possible, try running a slightly older version of Ubuntu LTS, or see if one of the edge/nightly builds fixes the issue. In the short term, you may have luck restarting the docker engine (systemctl restart docker) and possibly the entire host to see if that clears up the issue.


Since you ran the docker as 'sudo', you have to stop it with the 'sudo' privileges

To stop the container

sudo docker stop 203500ee7f1e

To remove the container

sudo docker rm 203500ee7f1e

If you want to stop and remove all the containers, the below command will be useful

sudo docker stop $(docker ps -a -q)  && sudo docker rm  $(docker ps -a -q)