Solution to the Docker container cannot be stopped and deleted

Solution to the Docker container cannot be stopped and deleted

Find the running container id

docker ps

Find the physical location of the container above

cd /var/lib/docker/container
ls -a
#The IDs of all containers will be displayed here. Find the ID that cannot be stopped from being deleted (8 digits)

Stop the docker service first

service docker stop

Deleting a physical container

rm -rf /var/lib/docker/container/{id found above}

Restart the Docker service

service docker start

Supplement: Docker exits the container without stopping the container and re-enters the running container

How to exit the docker container (note that it is inside the running container at this time):

Start the container

1. Exit the container and end the container operation exit

2. Exit the container but the container is still executing ctrl + p + q to return to the host desktop

But the container is still executing

3. 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

The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me.

You may also be interested in:
  • Solution to the problem that Docker cannot stop or delete container services
  • Docker stop stops/remove deletes all containers
  • How to batch delete stopped containers in Docker

<<:  Analysis and solution of the problem that MySQL instance cannot be started

>>:  HTML table border control implementation code

Recommend

vue+echarts realizes the flow effect of China map (detailed steps)

@vue+echarts realizes the flow effect of China ma...

Introduction to the process of creating TCP connection in Linux system

Table of contents Steps to create TCP in Linux Se...

MySQL 8.0.19 installation and configuration tutorial under Windows 10

I will be learning MySQL next semester. I didn...

How to create a Docker repository using Nexus

The warehouse created using the official Docker R...

Detailed explanation of MySQL's Seconds_Behind_Master

Table of contents Seconds_Behind_Master Original ...

Markup validation for doctype

But recently I found that using this method will c...

Solve the problem of not finding NULL from set operation to mysql not like

An interesting discovery: There is a table with a...

Optimizing query speed of MySQL with tens of millions of data using indexes

1. The role of index Generally speaking, an index...

Example of stars for CSS rating effect

What? What star coat? Well, let’s look at the pic...

Vue implements adding watermark effect to the page

Recently, when I was working on a project, I was ...

How to install kibana tokenizer inside docker container

step: 1. Create a new docker-compose.yml file in ...