Solution to the problem that the docker container cannot be stopped

Solution to the problem that the docker container cannot be stopped

The solution is as follows:

1. Force delete container

docker rm -f jenkins

2. Clean up the network usage of this container

docker network disconnect --force bridge jenkins

Docker cannot stop or kill the container

Recently, I encountered a problem that Docker cannot delete or kill the corresponding container. Either after running docker stop xxx, I found that xxx still exists, or I cannot delete it at all, or I find that an error is reported, prompting Error response from daemon: Conflict, cannot remove the default name of the container

A possible reason for this is that at some point in the past a named container was created and then you left it running. Afterwards, the host rebooted for whatever reason and the container was not terminated gracefully. The remaining files now appear to prevent you from regenerating a new container with the old name, because the system thinks the old container still exists.

Let's first use docker ps -a to look at the running records of all containers. Containers that exit abnormally will have a non-zero status code. Search for the one you need by name and delete it using the actual hex code docker rm xxxxxx.

However, sometimes it is found that -a does not provide any extra information. You can use the manual container deletion method. That is, delete the corresponding folder under /var/lib/docker/containers/, delete it, pay attention to use root permissions, and then systemctl restart docker.

This is the end of this article about the solution to the problem that the docker container cannot be stopped. For more information about how to solve the problem that the docker container cannot be stopped, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Solution to the problem that Docker container cannot be stopped or killed

<<:  WeChat applet implements countdown for sending SMS verification code

>>:  Problems and pitfalls of installing Mysql5.7.23 in Win10 environment

Recommend

How to let DOSBox automatically execute commands after startup

Using DOSBox, you can simulate DOS under Windows ...

CSS3 realizes the red envelope shaking effect

There is a requirement to realize the shaking eff...

Detailed explanation of JS ES6 variable destructuring assignment

Table of contents 1. What is deconstruction? 2. A...

Ubuntu terminal multi-window split screen Terminator

1. Installation The biggest feature of Terminator...

In-depth explanation of MySQL stored procedures (in, out, inout)

1. Introduction It has been supported since versi...

How to install mysql6 initialization installation password under centos7

1. Stop the database server first service mysqld ...

How to fill items in columns in CSS Grid Layout

Suppose we have n items and we have to sort these...

Solve the problem of MySQL using not in to include null values

Notice! ! ! select * from user where uid not in (...

Detailed explanation of type protection in TypeScript

Table of contents Overview Type Assertions in syn...

MySQL green decompression version installation and configuration steps

Steps: 1. Install MySQL database 1. Download the ...

Advertising skills in the Baidu Union environment (graphic tutorial)

Recently, students from the User Experience Team o...

Node uses async_hooks module for request tracking

The async_hooks module is an experimental API off...

Detailed usage of MYSQL row_number() and over() functions

Syntax format: row_number() over(partition by gro...