Reputation:
"Docker p"s shows 1 running container. The command "docker ps --filter status=running" shows the same process.
When trying to stop the container, I get the identification but nothing happens. The container is still running.
When I performing a 'docker kill id' I get:
Error response from daemon: Cannot kill container: xyz: Container 2f-etc is not running
I cannot perform a 'docker container rm name' because of this message:
Error response from daemon: driver "overlay2" failed to remove root filesystem for 2f-etc: remove /var/lib/docker/overlay2/0877e30fd3a98f46b981827b52aec02a7004649e2a9c01c72e38cc8de5b309b0/diff/tmp/hsperfdata_root/5: read-only file system
How to stop / kill that container?
What do I know more:
Upvotes: 13
Views: 23364
Reputation: 4013
The issue in my case was that I had docker installed from snap on Ubuntu server. After a bit of search I found that this might be an issue:
I followed the steps here, and then reinstalled with apt, and now it works.
For reference, there's a bigger discussion about docker installed through snap having some issues at: Docker Containers can not be stopped or removed - permission denied Error
Upvotes: 0
Reputation: 73
Sometimes docker restart
doesn't work, so you may have to individually run docker stop
& docker start
. Thereafter use the docker container rm <container>
command to remove.
Upvotes: 2
Reputation: 141
Restart docker is simple but global solution. In my case I needed to keep other containers working without stop and the solution of @juanlumn helped me, which is docker container rm -f name
(it removes container).
Upvotes: 14
Reputation:
As @Aderemi Dayo suggested - a restart of the Docker machine suffices.
Upvotes: 2