I run a container in the background using
docker run -d --name hadoop h_Service
it exits quickly. But if I run in the foreground, it works
Add this to the end of Dockerfile:
CMD tail -f /dev/null
Sample Docker file:
FROM ubuntu:16.04 # other commands CMD tail -f /dev/null
Reference