mirror of
https://github.com/dbt-labs/dbt-core
synced 2025-12-17 19:31:34 +00:00
* delete dbt-tests-adapter and dbt-postgres from dbt-core * update non-code files to reflect change * add changie * update build-dist.sh * update tox.ini * fix build-dist.sh * move adapter tests into /functional dir * remove adapter unit tests * update code comments and README.md
134 lines
3.5 KiB
Docker
134 lines
3.5 KiB
Docker
##
|
|
# Generic dockerfile for dbt image building.
|
|
# See README for operational details
|
|
##
|
|
|
|
# Top level build args
|
|
ARG build_for=linux/amd64
|
|
|
|
##
|
|
# base image (abstract)
|
|
##
|
|
# Please do not upgrade beyond python3.10.7 currently as dbt-spark does not support
|
|
# 3.11py and images do not get made properly
|
|
FROM --platform=$build_for python:3.10.7-slim-bullseye as base
|
|
|
|
# N.B. The refs updated automagically every release via bumpversion
|
|
ARG dbt_core_ref=dbt-core@v1.8.0a1
|
|
ARG dbt_postgres_ref=dbt-postgres@v1.8.0a1
|
|
ARG dbt_redshift_ref=dbt-redshift@v1.8.0a1
|
|
ARG dbt_bigquery_ref=dbt-bigquery@v1.8.0a1
|
|
ARG dbt_snowflake_ref=dbt-snowflake@v1.8.0a1
|
|
ARG dbt_spark_ref=dbt-spark@v1.8.0a1
|
|
# special case args
|
|
ARG dbt_spark_version=all
|
|
ARG dbt_third_party
|
|
|
|
# System setup
|
|
RUN apt-get update \
|
|
&& apt-get dist-upgrade -y \
|
|
&& apt-get install -y --no-install-recommends \
|
|
git \
|
|
ssh-client \
|
|
software-properties-common \
|
|
make \
|
|
build-essential \
|
|
ca-certificates \
|
|
libpq-dev \
|
|
&& apt-get clean \
|
|
&& rm -rf \
|
|
/var/lib/apt/lists/* \
|
|
/tmp/* \
|
|
/var/tmp/*
|
|
|
|
# Env vars
|
|
ENV PYTHONIOENCODING=utf-8
|
|
ENV LANG=C.UTF-8
|
|
|
|
# Update python
|
|
RUN python -m pip install --upgrade pip setuptools wheel --no-cache-dir
|
|
|
|
# Set docker basics
|
|
WORKDIR /usr/app/dbt/
|
|
ENTRYPOINT ["dbt"]
|
|
|
|
##
|
|
# dbt-core
|
|
##
|
|
FROM base as dbt-core
|
|
RUN python -m pip install --no-cache-dir "git+https://github.com/dbt-labs/${dbt_core_ref}#egg=dbt-core&subdirectory=core"
|
|
|
|
##
|
|
# dbt-postgres
|
|
##
|
|
FROM base as dbt-postgres
|
|
RUN python -m pip install --no-cache-dir "git+https://github.com/dbt-labs/${dbt_postgres_ref}#egg=dbt-postgres&subdirectory=plugins/postgres"
|
|
|
|
|
|
##
|
|
# dbt-redshift
|
|
##
|
|
FROM base as dbt-redshift
|
|
RUN python -m pip install --no-cache-dir "git+https://github.com/dbt-labs/${dbt_redshift_ref}#egg=dbt-redshift"
|
|
|
|
|
|
##
|
|
# dbt-bigquery
|
|
##
|
|
FROM base as dbt-bigquery
|
|
RUN python -m pip install --no-cache-dir "git+https://github.com/dbt-labs/${dbt_bigquery_ref}#egg=dbt-bigquery"
|
|
|
|
|
|
##
|
|
# dbt-snowflake
|
|
##
|
|
FROM base as dbt-snowflake
|
|
RUN python -m pip install --no-cache-dir "git+https://github.com/dbt-labs/${dbt_snowflake_ref}#egg=dbt-snowflake"
|
|
|
|
##
|
|
# dbt-spark
|
|
##
|
|
FROM base as dbt-spark
|
|
RUN apt-get update \
|
|
&& apt-get dist-upgrade -y \
|
|
&& apt-get install -y --no-install-recommends \
|
|
python-dev \
|
|
libsasl2-dev \
|
|
gcc \
|
|
unixodbc-dev \
|
|
&& apt-get clean \
|
|
&& rm -rf \
|
|
/var/lib/apt/lists/* \
|
|
/tmp/* \
|
|
/var/tmp/*
|
|
RUN python -m pip install --no-cache-dir "git+https://github.com/dbt-labs/${dbt_spark_ref}#egg=dbt-spark[${dbt_spark_version}]"
|
|
|
|
|
|
##
|
|
# dbt-third-party
|
|
##
|
|
FROM dbt-core as dbt-third-party
|
|
RUN python -m pip install --no-cache-dir "${dbt_third_party}"
|
|
|
|
##
|
|
# dbt-all
|
|
##
|
|
FROM base as dbt-all
|
|
RUN apt-get update \
|
|
&& apt-get dist-upgrade -y \
|
|
&& apt-get install -y --no-install-recommends \
|
|
python-dev \
|
|
libsasl2-dev \
|
|
gcc \
|
|
unixodbc-dev \
|
|
&& apt-get clean \
|
|
&& rm -rf \
|
|
/var/lib/apt/lists/* \
|
|
/tmp/* \
|
|
/var/tmp/*
|
|
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_redshift_ref}#egg=dbt-redshift"
|
|
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_bigquery_ref}#egg=dbt-bigquery"
|
|
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_snowflake_ref}#egg=dbt-snowflake"
|
|
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_spark_ref}#egg=dbt-spark[${dbt_spark_version}]"
|
|
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_postgres_ref}#egg=dbt-postgres&subdirectory=plugins/postgres"
|