Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker container won't start because an existing pid file

Tags:

docker

pid

When I start a docker container it fails because an existing pid file:

[root@newhope sergio]# docker logs sharp_shockley  httpd (pid 1) already running httpd (pid 1) already running httpd (pid 1) already running httpd (pid 1) already running 

How can I remove such a file, because I don't find it.

[root@newhope sergio]# docker version Client version: 1.4.1 Client API version: 1.16 Go version (client): go1.3.3 Git commit (client): 5bc2ff8/1.4.1 OS/Arch (client): linux/amd64 Server version: 1.4.1 Server API version: 1.16 Go version (server): go1.3.3 Git commit (server): 5bc2ff8/1.4.1  [root@newhope sergio]# find / -name "httpd.pid" find: ‘/run/user/1000/gvfs’: Permiso denegado 
like image 615
sebelk Avatar asked Feb 22 '15 03:02

sebelk


People also ask

What is docker PID file?

The docker.pid file stores the Windows process ID of the Docker daemon. When you try to host Docker daemon on port 2375 you might see an error as shown in the following screenshot: As the error explains, docker.pid already exists which means dockerd.exe is already running on the host machine.

How do I reset an existing container?

To restart an existing container, we'll use the start command with the -a flag to attach to it and the -i flag to make it interactive, followed by either the container ID or name. Be sure to substitute the ID of your container in the command below: docker start -ai 11cc47339ee1.

How do I force restart a docker container?

Using --restart unless-stopped tells Docker to always restart the command, no matter what the exit code of the command was. This way, you can have your application check its health, and if necessary use exit(1) or something similar to shutdown.

How do I restart a docker container on failure?

always – Docker will ensure the container is always running. If the container stops, it will be immediately restarted. You can still manually stop the container with docker stop but Docker will bring it back up next time the daemon restarts. on-failure – The container will get restarted if it stops because of an error.


1 Answers

Try:

docker-compose down 

To destroy any environments that are already running.

like image 175
styonsk Avatar answered Oct 10 '22 12:10

styonsk