Home  >  Article  >  Operation and Maintenance  >  What to do if the docker container cannot be stopped

What to do if the docker container cannot be stopped

WBOY
WBOYOriginal
2022-07-29 15:59:436656browse

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.

What to do if the docker container cannot be stopped

The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.

What to do if the docker container cannot be stopped

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:

What to do if the docker container cannot be stopped

Solution:

1. Use the forced deletion command: docker rm -f "container id" (remove the quotation marks);

What to do if the docker container cannot be stopped

#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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn