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
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.
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.
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.
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.
Try:
docker-compose down
To destroy any environments that are already running.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With