Docker run from command line or from a script

In Centos 7 environment I do have a image that I want to run. When issuing the command from the command line, it goes nice and smooth, but when I try to put that same command into a shell script the result changes. Run command executes and creates an instance, but it exits immediately with return value of 1 (one).

The very same command (cut/paste) given without script “envelope” works like wonder. The image in question is a daemon process (-d in run command) and it should stay running after the container is created.

What am I missing here? Why different results to the very same command?

What is the command you are trying to run?

If applicable, please include the corresponding Dockerfile so we can see what is going on inside image.

What is the command you are trying to run?

If applicable, please include the corresponding Dockerfile so we can see what is going on inside image.