Docker container disappears without notice

Tarlen picture Tarlen · Jul 25, 2016 · Viewed 12.6k times · Source

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?

Answer

Matt picture Matt · Jul 25, 2016

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>