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
Adding
exec "$@"
at the end of my shell script was my fix!