Docker Community Forums

Share and learn in the Docker community.

Runtime flag to keep container up past entrypoint termination

What do y’all use for entrypoint commands in order to force a container to stay up, so that you can connect to a terminal and diagnose failing applications?

I’ve tried a couple things like ping (not necessarily installed by default), top (requires a tty), yes (crashed Kubernetes cluster), and sleep 3600 (restarts terminal every minute). There doesn’t appear to be a Linux-standard or Windows-standard command for use here, without compiling your own while () { sleep(3600); } loop application?

Would it be helpful for Docker to offer a runtime flag like --diehard 1h, to give users a straightforward, portable way to debug failing apps?