如何将参数传递给dockerfile?
让我们说我有dockerfile:
FROM ubuntu:14.04
MAINTAINER Karl Morrison
sudo do-something-here myVarHere
我想建立文件,例如:
docker build basickarl/my-image-example /directory/of/my/dockerfile "my string to be passed to myVarHere here!"
Docker有你可以在这里使用的ARG
原文链接:https://www.f2er.com/docker/436250.htmlFROM ubuntu:14.04
MAINTAINER Karl Morrison
ARG myVarHere
RUN do-something-here myVarHere
然后使用–build-arg构建:
docker build --build-arg myVarHere=value