Docker container disappears without notice
Asked Answered
P

2

13

I host my webapplication is a docker container using Dokku.

Sometimes (maybe every 1-2 days) the docker container just disappears (doesnt show when docker ps) and as a result, my server goes down.

I haven't been able to find the cause.

I am looking for a way to debug this, any ideas?

Plebs answered 25/7, 2016 at 8:24 Comment(4)
Does it show in docker ps -a?Kriemhild
Ah yeah, didn't know that flag. It shows as Exited (255) 4 hours ago Plebs
Dokku Maintainer here: You should checkout the docker logs output (as mentioned in a comment below) and also you might want to figure out if your application is segfaulting for some reason. Our upcoming release will have restart-policy management, though you can always add restart policies using the official docker-options plugin directly.Illustrative
Logs didn't show anything unusual unfortunately. Any soft ETA on restart-policy management?Plebs
P
8

The Docker logs will give you the stdout and stderr for the container. Your application may or may not provide useful information here.

docker logs <containerid_or_name> 

The Docker daemon can manage a long running container for you with a --restart policy.

docker run --restart=always <image>
Pyrrolidine answered 25/7, 2016 at 8:49 Comment(0)
E
3

Your application server has crashed apparently for whatever reason. you can see why with using docker logs {container_id} . also to prevent your application from going down in the future use --restart=always with your docker run so it will restart automatically on each crash

Enviable answered 25/7, 2016 at 8:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.