How to debug a permanent restarting container?

I talked about this on the 6th Docker Community All-Hands

If it stops, then your command finished without an error. You need a command that runs forever keeping the container alive.

PS.: Please, fomat your post using code blocks (not just here on the forum, everywhere where you need to share code) so we will understand it without missing indentation and altered content.