For the `docker_image` target how can I specify ad...
# general
q
For the
docker_image
target how can I specify additional contexts like this in the BUILD file?
c
That seems to be a docker compose feature, so would not be available from pants.
q
I don’t think it is limited to docker-compose. I use it as
Copy code
docker build \
    --build-arg ABC="***" \
    -t my-project:latest \
    --build-context "extra=${HOME}/.cofig/auth/" src/my-project/
and within the Dockerfile the additional build-context is used as
Copy code
...
COPY --from=extra auth.json /root/.config/auth/auth.json
...
I guess this would have been a more appropriate link instead of the docker-compose one - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context
c
Ah, right! Yea, the Dockerfile instruction is available as-is, naturally. The cli option is lacking passing arbitrary args, iirc. There’s no bespoke pants feature for this as far as I know.