【发布时间】:2021-10-19 19:10:08
【问题描述】:
我正在构建一个 docker 文件,但它在第一行失败。
FROM artifactory.company.com/local-docker-repo/dockerimage/docker-batch-base:$VERSION
我以这种方式传递构建参数
docker image build --build-arg VERSION=latest -q -t artifactory.company.com/local-docker-repo/batch/batch-run-sst:1.0-SNAPSHOT .
但是它会抛出一个错误,说无效的参考格式
Step 1/5 : FROM artifactory.company.com/local-docker-repo/dockerimage/docker-batch-base:$VERSION
invalid reference format
我在这里错过了什么
【问题讨论】:
-
你声明
ARG VERSION了吗? -
这能回答你的问题吗? Can a variable be used in docker FROM?
标签: docker build dockerfile arguments