how to read input of shell-script in docker container creating in detach mode

Viewed 30
docker run -d --name test -e Env=prod testimage

logs of container:

docker logs test

output:

Enter Environment Name local, prod or test:

Environment is not found

How to pass script input in detach mode?

1 Answers

The right mode are the environment variables which you used, by I see an error in your command line:

docker run -d --name test-e Env=prod testimage

Between -name test and -e Env=prod you missed a space:

docker run -d --name test -e Env=prod testimage
Related