Solution to the inability to stop the docker container: 1. Use the "docker rm -f container id that cannot be stopped" command to forcefully delete the specified container; 2. Use "docker network disconnect --force bridge container id" command to clean up the network usage of the container.
The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.
Recently, I encountered that docker cannot be deleted, or the corresponding container is killed, or after running docker stop xxx, it is found that xxx still exists, or it cannot be deleted at all. , or you find that an error is reported, prompting Error response from daemon: Conflict, cannot remove the default name of the container; the possible cause of this situation is that a named container has been created at some point in the past, and then you have retained it Operating status. Afterwards, the host restarts for any reason and the container is not terminated gracefully. The remaining files now seem to prevent you from regenerating a new container with the old name because the system thinks the old container still exists.
The container cannot be stopped through the docker stop command:
Solution:
1. Use the forced deletion command: docker rm -f "container id" (remove the quotation marks);
#2. Clean up the network occupation of the container: docker network disconnect --force bridge "container id" (remove the quotation marks);
Recommended learning: "docker video tutorial"
The above is the detailed content of What to do if the docker container cannot be stopped. For more information, please follow other related articles on the PHP Chinese website!