2017-10-12 9 views
0

docker run -eが動作しない、バグ? <a href="https://docs.docker.com/engine/reference/run/#env-environment-variables" rel="nofollow noreferrer">docs</a>に従って

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 

私は私のコンテナにドッキングウィンドウの実行-eを実行しようとした:

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

私はこのエラーを取得する:

[FATAL tini (7)] exec -e failed: No such file or directory 
+0

あなたの旗は 'myimage123'の前にはいけませんか? – user2662833

答えて

2

してみてください。

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

ここでの問題は、-eがフラグであり、myimage123が引数であることです。したがって、引数は常にフラグの後に来る必要があります。

関連する問題

 関連する問題