9

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?

Tarlen
  • 3,327
  • 6
  • 25
  • 50
  • 8
    Does it show in `docker ps -a`? – Oliver Charlesworth Jul 25 '16 at 08:24
  • Ah yeah, didn't know that flag. It shows as `Exited (255) 4 hours ago ` – Tarlen Jul 25 '16 at 08:34
  • 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](https://github.com/dokku/dokku/pull/2290), though you can always add restart policies using the official [docker-options plugin](http://dokku.viewdocs.io/dokku/advanced-usage/docker-options/) directly. – Jose Diaz-Gonzalez Jul 25 '16 at 17:32
  • Logs didn't show anything unusual unfortunately. Any soft ETA on restart-policy management? – Tarlen Jul 25 '16 at 20:40

2 Answers2

4

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>
Matt
  • 51,189
  • 6
  • 117
  • 122
2

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

Miad Abrin
  • 936
  • 7
  • 14