<#18004 Docker build args dependency inference hap...
# github-notifications
q
#18004 Docker build args dependency inference happens too early Issue created by tobni Describe the bug To reference images in the FROM clause of Dockerfiles, following snippet can be used.
Copy code
ARG SOME_IMAGE="path/to/some-image:target"
FROM $SOME_IMAGE
which will prompt pants to build the image for the
docker_image
target
path/to/some-image:target
and use it. If
./pants package <target> --docker-build-args="SOME_IMAGE=<reference-to-e.g docker-hub>
is passed, the ARG is correctly replaced when building the snippet docker image. However, pants will still first build
path/to/some-image:target
, even though it will not be used. Pants version 2.13.0 OS Ubuntu 22.04 Additional info Link to slack chat about this behaviour being a bug. pantsbuild/pants