Skip to content

Commit 94981c4

Browse files
authored
fix: update Docker base images to Trixie and force pull latest images in nightly builds (#13015)
- Update builder stage: bookworm-slim → trixie-slim (5 Dockerfiles) - Update runtime stage: python:3.12.13-slim-trixie → python:3.12-slim-trixie - Add pull: true to 6 Docker build steps in nightly workflow - Forces pulling latest base images instead of using cached layers This resolves CVE vulnerabilities in Docker images by ensuring we use the latest Debian Trixie base images instead of cached Bookworm layers.
1 parent f08885f commit 94981c4

6 files changed

Lines changed: 16 additions & 10 deletions

.github/workflows/docker-nightly-build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ jobs:
117117
with:
118118
context: .
119119
push: ${{ inputs.push_to_registry }}
120+
pull: true
120121
file: ./docker/build_and_push_base.Dockerfile
121122
tags: ${{ steps.tags.outputs.docker_tags }}
122123
platforms: linux/${{ matrix.arch }}
@@ -129,6 +130,7 @@ jobs:
129130
with:
130131
context: .
131132
push: ${{ inputs.push_to_registry }}
133+
pull: true
132134
file: ./docker/build_and_push_base.Dockerfile
133135
tags: ${{ steps.tags.outputs.ghcr_tags }}
134136
platforms: linux/${{ matrix.arch }}
@@ -210,6 +212,7 @@ jobs:
210212
with:
211213
context: .
212214
push: ${{ inputs.push_to_registry }}
215+
pull: true
213216
file: ./docker/build_and_push.Dockerfile
214217
tags: ${{ steps.tags.outputs.docker_tags }}
215218
platforms: linux/${{ matrix.arch }}
@@ -222,6 +225,7 @@ jobs:
222225
with:
223226
context: .
224227
push: ${{ inputs.push_to_registry }}
228+
pull: true
225229
file: ./docker/build_and_push.Dockerfile
226230
tags: ${{ steps.tags.outputs.ghcr_tags }}
227231
platforms: linux/${{ matrix.arch }}
@@ -303,6 +307,7 @@ jobs:
303307
with:
304308
context: .
305309
push: ${{ inputs.push_to_registry }}
310+
pull: true
306311
file: ./docker/build_and_push_with_extras.Dockerfile
307312
tags: ${{ steps.tags.outputs.docker_tags }}
308313
platforms: linux/${{ matrix.arch }}
@@ -315,6 +320,7 @@ jobs:
315320
with:
316321
context: .
317322
push: ${{ inputs.push_to_registry }}
323+
pull: true
318324
file: ./docker/build_and_push_with_extras.Dockerfile
319325
tags: ${{ steps.tags.outputs.ghcr_tags }}
320326
platforms: linux/${{ matrix.arch }}

docker/build_and_push.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# 1. use python:3.12.3-slim as the base image until https://github.com/pydantic/pydantic-core/issues/1292 gets resolved
1010
# 2. do not add --platform=$BUILDPLATFORM because the pydantic binaries must be resolved for the final architecture
1111
# Use a Python image with uv pre-installed
12-
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
12+
FROM ghcr.io/astral-sh/uv:python3.12-trixie-slim AS builder
1313

1414
# Install the project into `/app`
1515
WORKDIR /app
@@ -75,7 +75,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
7575
# RUNTIME
7676
# Setup user, utilities and copy the virtual environment only
7777
################################
78-
FROM python:3.12.13-slim-trixie AS runtime
78+
FROM python:3.12-slim-trixie AS runtime
7979

8080

8181
RUN apt-get update \

docker/build_and_push_backend.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
################################
99
# BUILDER
1010
################################
11-
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
11+
FROM ghcr.io/astral-sh/uv:python3.12-trixie-slim AS builder
1212

1313
WORKDIR /app
1414

@@ -44,7 +44,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
4444
################################
4545
# RUNTIME
4646
################################
47-
FROM python:3.12.13-slim-trixie AS runtime
47+
FROM python:3.12-slim-trixie AS runtime
4848

4949
# Install minimal runtime dependencies
5050
RUN apt-get update \

docker/build_and_push_base.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# 1. use python:3.12.3-slim as the base image until https://github.com/pydantic/pydantic-core/issues/1292 gets resolved
1111
# 2. do not add --platform=$BUILDPLATFORM because the pydantic binaries must be resolved for the final architecture
1212
# Use a Python image with uv pre-installed
13-
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
13+
FROM ghcr.io/astral-sh/uv:python3.12-trixie-slim AS builder
1414

1515
# Install the project into `/app`
1616
WORKDIR /app
@@ -77,7 +77,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
7777
# RUNTIME
7878
# Setup user, utilities and copy the virtual environment only
7979
################################
80-
FROM python:3.12.13-slim-trixie AS runtime
80+
FROM python:3.12-slim-trixie AS runtime
8181

8282

8383
RUN apt-get update \

docker/build_and_push_ep.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# 1. use python:3.12.3-slim as the base image until https://github.com/pydantic/pydantic-core/issues/1292 gets resolved
1010
# 2. do not add --platform=$BUILDPLATFORM because the pydantic binaries must be resolved for the final architecture
1111
# Use a Python image with uv pre-installed
12-
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
12+
FROM ghcr.io/astral-sh/uv:python3.12-trixie-slim AS builder
1313

1414
# Install the project into `/app`
1515
WORKDIR /app
@@ -72,7 +72,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
7272
# RUNTIME
7373
# Setup user, utilities and copy the virtual environment only
7474
################################
75-
FROM python:3.12.13-slim-trixie AS runtime
75+
FROM python:3.12-slim-trixie AS runtime
7676

7777
RUN apt-get update \
7878
&& apt-get upgrade -y \

docker/build_and_push_with_extras.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# 1. use python:3.12.3-slim as the base image until https://github.com/pydantic/pydantic-core/issues/1292 gets resolved
1010
# 2. do not add --platform=$BUILDPLATFORM because the pydantic binaries must be resolved for the final architecture
1111
# Use a Python image with uv pre-installed
12-
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
12+
FROM ghcr.io/astral-sh/uv:python3.12-trixie-slim AS builder
1313

1414
# Install the project into `/app`
1515
WORKDIR /app
@@ -72,7 +72,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
7272
# RUNTIME
7373
# Setup user, utilities and copy the virtual environment only
7474
################################
75-
FROM python:3.12.13-slim-trixie AS runtime
75+
FROM python:3.12-slim-trixie AS runtime
7676

7777

7878
RUN apt-get update \

0 commit comments

Comments
 (0)