Solution: 1. Use “docker ps” to find the running container id; 2. Use “cd /var/lib/docker/container” to find the physical location of the specified container; 3. Use “service docker stop” "Stop the docker service; 4. Use "rm -rf /var/lib/docker/container/{specified id}" to delete the physical container, and then restart the docker service.
The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.
Solution:
1. Find the running container id
docker ps
2. Find the physical location of the container above
cd /var/lib/docker/container ls -a #此处会显示所有容器的id,找出上面那个无法停止删除的id(8位)
3. Stop the docker service first
service docker stop
4. Delete the physical container
rm -rf /var/lib/docker/container/{上面找到的id}
Restart the docker service
service docker start
Expand knowledge
Docker exits the container without stopping the container and re-enters the running container
How docker exits the container (note that it is inside the running container at this time):
Start the container
Exit the container and end the container running exit
Exit the container but the container is still executing ctrl p q and will return to the host desktop
But the container is still executing
How to return to a container that has exited but is still running
Method 1: docker attach container id
##Method 2: docker exec -it container ID bashShell Recommended learning: "docker video tutorial"
The above is the detailed content of What should I do if docker cannot stop deleting containers?. For more information, please follow other related articles on the PHP Chinese website!