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

Analyzing Linux high-performance network IO and Reactor model

Table of contents 1. Introduction to basic concep...

...

Detailed explanation of the basic knowledge of front-end componentization

Table of contents Basic concepts of components Th...

Vue3 (V) Details of integrating HTTP library axios

Table of contents 1. Install axios 2. Use of axio...

Analysis and solutions to problems encountered in the use of label tags

I used the label tag when I was doing something re...

SpringBoot integrates Activiti7 implementation code

After the official release of Activiti7, it has f...

Recommend several MySQL related tools

Preface: With the continuous development of Inter...

How to authorize remote connections in MySQL in Linux

Note: Other machines (IP) cannot connect to the M...

Understanding MySQL index pushdown in five minutes

Table of contents What is index pushdown? The pri...

CentOS 6-7 yum installation method of PHP (recommended)

1. Check the currently installed PHP packages yum...

How to use resident nodes for layer management in CocosCreator

CocosCreator version: 2.3.4 Most games have layer...

Learn MySQL index pushdown in five minutes

Table of contents Preface What is index pushdown?...

MySQL 5.7.21 installation and configuration method graphic tutorial (window)

Install mysql5.7.21 in the window environment. Th...

Detailed installation history of Ubuntu 20.04 LTS

This article records the creation of a USB boot d...

Example code for using @media in CSS3 to achieve web page adaptation

Nowadays, the screen resolution of computer monit...