Error response from daemon: conflict: Conflict when trying to create Docker container, so solution

Overview

An error occurred when launching the container, so I will summarize the countermeasures and commands.

Error statement

Terminal


Error response from daemon: Conflict. The container name "Container name" is already in use by container "Container ID". You have to remove (or rename) that container to be able to reuse that name.

The container already exists, so please rename or delete it. In short, you can't create multiple same container names! !!

hypothesis

--See the list of running containers. --Stopped operation and deleted the container.

Required commands

Docker command Remarks
docker ps List of operating containers
docker ps -a Container list
docker stop container ID Stop the running container
docker rm (-f)Container ID Delete the stopped container *-Forced deletion with f option

It is important to note that the container can only be deleted after the container has been stopped.
After stopping the running container with the stop command, was it possible to stop the running container instead of deleting it as it is ***? After confirming, delete ***. Also, check if the deletion was successful even after the deletion was successful. *** *** Or if you forcibly delete it with the -f option, you can delete it even while the container is running.
*** I thought that if you make a habit of checking each time like this, the probability of getting hurt later will decrease. *** ***

Create container again

image.png

Error that the cookie is large. If you read it, cookies are probably accumulated, so delete it! !! I think it's like that. Immediately delete the accumulated cookies and check the behavior.

image.png

*** I was able to run the nginx container as hypothesized! !! *** ***

Summary

--Containers cannot be made with the same name. --Since the command is slightly different between container deletion and image deletion (rmi or rm), it calms down even if deletion fails. -- i in rmi is an image, which means to remove i. --Get in the habit of checking if the behavior is correct after typing the command.

References

This article was written with reference to the following information.

-How to delete Docker image and container -What to do when "400 Bad Request Header Or Cookie Too Large" appears in Chrome

Recommended Posts

Error response from daemon: conflict: Conflict when trying to create Docker container, so solution
Error: Error response from daemon: No such container:
About the solution of the error that occurred when trying to create a Japanese file of devise in the Docker development environment
I tried to use docker with jetson jetpack4.3 but got an error (docker: Error response from daemon: OCI runtime create failed: container_linux.go: 345: starting container process caused ...)
Solution for the error "no basic auth credentials" when pushing a Docker container to Heroku
Error when trying to use heroku command
[Docker] Copy files from docker container to host
Solution that gives an error when trying to connect to DB (MySQL) in Java
[Error resolution] Occurs when trying to build an environment for spring with docker
How to get a heapdump from a Docker container
Setting to exit from Docker container with VScode
Copy files from docker container to host (docker cp)
Docker for Windows: MySQL container does not start when migrating from Hyper-v to WSL2
A memorandum when trying to create a GUI using JavaFX
Create a Docker container to convert EPS to PGF source
Push Docker images from GitHub Actions to GitHub Container Registry
When trying to insert a specific gem (levenshtein) with Docker, an error occurred without ruby-dev
Docker --OCIC runtime create failed error ("process_linux.go: 449: container init caused \")
[Docker] How to access the host from inside the container. http://host.docker.internal:
I was angry with proc_open (): fork failed when trying to composer update inside a Docker container