2

My DockerFile:

FROM puckel/docker-airflow

...

# rest of file

Looking at the source DockerFile of puckel/docker-airflow, I see there are several args that can be configured at build time, which I want to do:

# contents of puckel/docker-airflow

...

# Airflow
ARG AIRFLOW_VERSION=1.10.6
ARG AIRFLOW_USER_HOME=/usr/local/airflow
ARG AIRFLOW_DEPS=""
ARG PYTHON_DEPS=""

I know I can set these args using docker build and adding the flag(s), for example docker build --build-arg AIRFLOW_VERSION=1.11 ... for example, but how can I set these args within my DockerFile itself?

2
  • You did set it in your Dockerfile, e.g. AIRFLOW_VERSION=1.10.6 Commented Jan 6, 2020 at 23:26
  • No, that's the contents of the DockerFile that I'm FROMing from. I want to know how to change the AIRFLOW_VERSION when I pull it using FROM Commented Jan 6, 2020 at 23:33

1 Answer 1

2

This isn't possible. When you build FROM another image, you are building from the result of a previous build. The parent image has already been created, and the ARGs have already been used. You have to rebuild the parent image with different args if you want changes applied there.

Note that build args are scoped, they only exist within the build stage (or Dockerfile for global args), and are not directly available to be used in child images.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.