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 set the position of the block element in the middle of the window

How to set the position of the block element in t...

MySQL not null constraint case explanation

Table of contents Set a not null constraint when ...

Introduction to network drivers for Linux devices

Wired network: Ethernet Wireless network: 4G, wif...

In-depth analysis of MySQL query interception

Table of contents 1. Query Optimization 1. MySQL ...

HTML+CSS to achieve layered pyramid example

This article mainly introduces the example of imp...

What is ssh port forwarding? What's the use?

Table of contents Preface 1. Local port forwardin...

Example of using rem to replace px in vue project

Table of contents tool Install the plugin Add a ....

Summary of MySQL Undo Log and Redo Log

Table of contents Undo Log Undo Log Generation an...

Basic usage details of Vue componentization

Table of contents 1. What is componentization? 2....

Detailed explanation of key uniqueness of v-for in Vue

Table of contents 1. DOM Diff 2. Add key attribut...

Use pictures to realize personalized underline of hyperlinks

Don't be surprised if you see some kind of und...

The complete version of the common Linux tool vi/vim

Why learn vim Linux has a large number of configu...

MySQL string splitting operation (string interception containing separators)

String extraction without delimiters Question Req...

UCenter Home site adds statistics code

UCenter Home is an SNS website building system rel...