Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker run -e not working, bug?

Tags:

docker

according to the docs:

Additionally, the operator can set any environment variable in the container by using one or more -e flags, even overriding those mentioned above, or already defined by the developer with a Dockerfile ENV. If the operator names an environment variable without specifying a value, then the current value of the named variable is propagated into the container’s environment:

$ export today=Wednesday
$ docker run -e "deep=purple" -e today --rm alpine env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=d2219b854598
deep=purple
today=Wednesday
HOME=/root

I tried to run docker run -e with my container:

docker run -d -it myimage123 -e "myvar=blah"

I get this error:

[FATAL tini (7)] exec -e failed: No such file or directory
like image 731
red888 Avatar asked Oct 29 '25 08:10

red888


1 Answers

Try:

docker run -d -it -e "myvar=blah" myimage123

The problem here is that -e is a flag and myimage123 is an argument. So the arguments should always come after the flags.

like image 198
user2662833 Avatar answered Oct 31 '25 01:10

user2662833



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!