0

I'm building a docker file and the it fails at the first line.

FROM artifactory.company.com/local-docker-repo/dockerimage/docker-batch-base:$VERSION

I pass the build arguments this way

docker image build --build-arg VERSION=latest -q -t artifactory.company.com/local-docker-repo/batch/batch-run-sst:1.0-SNAPSHOT .

But it throws an error saying invalid reference format

Step 1/5 : FROM artifactory.company.com/local-docker-repo/dockerimage/docker-batch-base:$VERSION
invalid reference format

What am I missing here

gaby7457
  • 103
  • 1
  • 7
  • 2
    Have you declared a `ARG VERSION`? – Ali Tou Oct 19 '21 at 23:55
  • Does this answer your question? [Can a variable be used in docker FROM?](https://stackoverflow.com/questions/36556766/can-a-variable-be-used-in-docker-from) – Ali Tou Oct 19 '21 at 23:55

1 Answers1

0

I had to declare ARG VERSION in the docker file before using it. Thanks @Ali Tou

gaby7457
  • 103
  • 1
  • 7