Like Blake Mitchell sais, you cannot use ARG
in ENTRYPOINT
. However you can use your ARG
as a value for ENV
, that way you can use it with ENTRYPOINT
:
Dockerfile
ARG my_arg
ENV my_env_var=$my_arg
ENTRYPOINT echo $my_env_var
and run:
docker build --build-arg "my_arg=foo" ...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…