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

Detailed explanation of React component communication

Table of contents Component Communication Introdu...

HTML table tag tutorial (26): cell tag

The attributes of the <TD> tag are used to ...

Vue codemirror realizes the effect of online code compiler

Preface If we want to achieve the effect of onlin...

Why does MySQL paging become slower and slower when using limit?

Table of contents 1. Test experiment 2. Performan...

How to implement JavaScript's new operator yourself

Table of contents Constructor new Operator Implem...

Detailed explanation of JS ES6 coding standards

Table of contents 1. Block scope 1.1. let replace...

mysql5.7 create user authorization delete user revoke authorization

1. Create a user: Order: CREATE USER 'usernam...

Vue implements an Input component that gets the key display shortcut key effect

I encountered a requirement to customize shortcut...

Summary of MySQL usage specifications

1. InnoDB storage engine must be used It has bett...

I have compiled a few cool design sites that I think are good.

You must have inspiration to design a website. Goo...

Personal opinion: Talk about design

<br />Choose the most practical one to talk ...

Error mysql Table 'performance_schema...Solution

The test environment is set up with a mariadb 5.7...