Reputation: 19388
I am trying to set environment variables in a docker container but I get the following error
starting container process caused "exec: \"-e\": executable file not found in $PATH": unknown
Here is how I set the variables
docker run image -e ENV_VAR= '{"a":{"b":"c"}}' -p 3000:3000
What am I missing?
Upvotes: 0
Views: 2043
Reputation: 263666
The docker command is order sensitive. Everything after the image name is the command you want to run inside the container. Place the image name after the flags to the run command:
docker run -e ENV_VAR='{"a":{"b":"c"}}' -p 3000:3000 image
Upvotes: 3