How to log into Docker container

I have a java hello world application running in Docker container. It exits after printing 'hello world'

I can not log into container now because it exits.

docker exec -it <container name> /bin/bash

Is there any way I can hold it so that I can log into container ?

submitted by /u/anacondaonline
[link] [comments]
Source: Reddit