Home >Operation and Maintenance >Docker >What should I do if docker cannot stop deleting containers?

What should I do if docker cannot stop deleting containers?

WBOY
WBOYOriginal
2022-07-25 16:21:355141browse

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.

What should I do if docker cannot stop deleting containers?

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

What should I do if docker cannot stop deleting the container?

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

What should I do if docker cannot stop deleting containers?

Exit the container and end the container running exit

What should I do if docker cannot stop deleting containers?

Exit the container but the container is still executing ctrl p q and will return to the host desktop

What should I do if docker cannot stop deleting containers?

But the container is still executing

What should I do if docker cannot stop deleting containers?

How to return to a container that has exited but is still running

Method 1: docker attach container id

What should I do if docker cannot stop deleting containers?

##Method 2: docker exec -it container ID bashShell

What should I do if docker cannot stop deleting containers?

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!

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