Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Upgrade Docker image to debian slim bookworm #522

Open
3 tasks done
nicohein opened this issue Jan 3, 2025 · 0 comments
Open
3 tasks done

[Feature] Upgrade Docker image to debian slim bookworm #522

nicohein opened this issue Jan 3, 2025 · 0 comments
Labels
pkg:dbt-bigquery Issue affects dbt-bigquery type:enhancement New feature request

Comments

@nicohein
Copy link

nicohein commented Jan 3, 2025

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt-bigquery functionality, rather than a Big Idea better suited to a discussion

Describe the feature

The dbt-bigquery Docker image is currently on python:3.11.2-bullseye. I suggest an upgrade to python:3.12.8-slim-bookworm given that you already support python 3.12.8 and Debian Bulleye will go into LTS in August 2025 [1].

[1] https://www.debian.org/releases/

Describe alternatives you've considered

While having removed the version pinning of some libraries, here is an updated Dockerfile, that also reduces image size by utilizing multi stage builds a little bit differently than in the existing Dockerfile.

ARG py_version=3.12.8

FROM python:$py_version-slim-bookworm AS build

RUN apt-get update \
    && apt-get dist-upgrade -y \
    && apt-get install -y --no-install-recommends \
      build-essential \
      ca-certificates \
      git \
      libpq-dev \
      make \
      openssh-client \
      software-properties-common \
    && apt-get clean \
    && rm -rf \
      /var/lib/apt/lists/* \
      /tmp/* \
      /var/tmp/*

ENV PYTHONIOENCODING=utf-8
ENV LANG=C.UTF-8

RUN python -m pip install --upgrade pip setuptools wheel --no-cache-dir

WORKDIR /usr/app/dbt/
ARG commit_ref=main
RUN python -m pip install --no-cache-dir "dbt-bigquery @ git+https://github.com/dbt-labs/dbt-bigquery@${commit_ref}"

# Final lightweight production image
FROM python:$py_version-slim-bookworm AS production

COPY --from=build /usr/local /usr/local

# Healthcheck and entrypoint
HEALTHCHECK CMD dbt --version || exit 1
WORKDIR /usr/app/dbt/
ENTRYPOINT ["dbt"]

Who will this benefit?

Smaller image size can help reduce overhead for deployments. The later Python and Debian versions in addition to removing the version pinning help to reduce the number of vulnerabilities reported by trivy image --report summary --scanners vuln --severity HIGH,CRITICAL. I do understand version pinning to be important for stability.

Are you interested in contributing this feature?

Yes

Anything else?

No response

@nicohein nicohein added type:enhancement New feature request triage:product In Product's queue labels Jan 3, 2025
@amychen1776 amychen1776 removed the triage:product In Product's queue label Jan 6, 2025
@mikealfare mikealfare added the pkg:dbt-bigquery Issue affects dbt-bigquery label Jan 14, 2025
@mikealfare mikealfare transferred this issue from dbt-labs/dbt-bigquery Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:dbt-bigquery Issue affects dbt-bigquery type:enhancement New feature request
Projects
None yet
Development

No branches or pull requests

3 participants