Docker文件:
# copy over system jboss configs
ARG SYSTEM_TYPE
COPY $SYSTEM_TYPE/AP/standalone.conf $JBOSS_HOME/bin/standalone.conf
COPY $SYSTEM_TYPE/AP/standalone-ha-bob.xml $JBOSS_HOME/bin/standalone-ha-bob.xml
Docker Command:
docker build --build-arg SERVER_TYPE=jbossconf/ENT-UAT/ -f /usr/etc/repos/docker-files/test-dockerfile-app -t appserver/test:1.0 .
Docker构建结果:
Step 15 : COPY $SYSTEM_TYPE/AP/standalone.conf $JBOSS_HOME/bin/standalone.conf
lstat AP/standalone.conf: no such file or directory
--build-arg似乎没有传递给dockerfile。我哪里错了?
答案 0 :(得分:1)
在你的构建args上你传递了SERVER_TYPE并在你的dockerfile上引用了$ SYSTEM_TYPE,应该修复它!