Home>Article>Operation and Maintenance> What to do if docker stop container fails
Solution to docker stop container failure: 1. Use the forced deletion command "docker rm -f "container id""; 2. Clean the container through "docker network disconnect --force bridge "container id"" of network usage.
The operating environment of this article: centos7 system, Docker version 20.10.11, Dell G3 computer.
What should I do if the docker container fails to stop?
The solution to the problem that the docker container cannot be stopped:
I recently encountered docker It cannot be deleted, or the corresponding container is killed, or it is found that xxx still exists after running docker stop xxx, or it cannot be deleted at all, or 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 at some point in the past, a named container has been created and then you have left it running. 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:
Use the forced deletion command: docker rm -f "container id" (remove the quotation marks); Clean up the network occupation of the container: docker disconnect --force bridge "container id" (remove the quotation marks); Recommended learning: "docker tutorial"
The above is the detailed content of What to do if docker stop container fails. For more information, please follow other related articles on the PHP Chinese website!