data-engineering-zoomcamp icon indicating copy to clipboard operation
data-engineering-zoomcamp copied to clipboard

Week 4 - DBT build ARGs not being correctly passed after FROM

Open jerdra opened this issue 3 years ago • 1 comments

Hey DataTalks zoompcamp team!

I'm not sure if I'm the only person having this issue but it looks like the Dockerfile file provided in Week 4 for building dbt-bigquery fails to build. Namely the ARGs defined at the beginning of the Dockerfile aren't made available during each part of the multi-stage build.

I think each particular ARG needs to be defined after each FROM statement for it to be accessible during a particular build stage.

i.e:

...
FROM base as dbt-core
ARG [email protected]
RUN echo python -m pip install --no-cache-dir "git+https://github.com/dbt-labs/${dbt_core_ref}#egg=dbt-core&subdirectory=core" \
  && python -m pip install --no-cache-dir "git+https://github.com/dbt-labs/${dbt_core_ref}#egg=dbt-core&subdirectory=core"

The Docker Docs on this behaviour make a claim that you don't need to re-define a default value after FROM (i.e leave it as ARG dbt_core_ref but that hasn't worked on my system using Docker 20.10.12.

jerdra avatar Feb 19 '22 20:02 jerdra

Maybe try asking in Slack?

alexeygrigorev avatar Mar 02 '22 16:03 alexeygrigorev