21
21
# in `poetry export` in the past.
22
22
23
23
ARG DEBIAN_VERSION=bookworm
24
+ ARG DEBIAN_VERSION_NUMERIC=12
24
25
ARG PYTHON_VERSION=3.12
25
26
ARG POETRY_VERSION=1.8.3
26
27
@@ -109,9 +110,9 @@ RUN \
109
110
fi
110
111
111
112
# ##
112
- # ## Stage 2: runtime dependencies download for ARM64 and AMD64
113
+ # # Stage 2: runtime dependencies download for ARM64 and AMD64
113
114
# ##
114
- FROM --platform=$BUILDPLATFORM docker .io/library/debian :${DEBIAN_VERSION} AS runtime-deps
115
+ FROM --platform=$BUILDPLATFORM ghcr .io/astral-sh/uv :${DEBIAN_VERSION} AS runtime-deps
115
116
116
117
# Tell apt to keep downloaded package files, as we're using cache mounts.
117
118
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
@@ -120,6 +121,15 @@ RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloa
120
121
RUN dpkg --add-architecture arm64
121
122
RUN dpkg --add-architecture amd64
122
123
124
+ ARG PYTHON_VERSION
125
+ RUN uv python install \
126
+ cpython-${PYTHON_VERSION}-linux-aarch64-gnu \
127
+ cpython-${PYTHON_VERSION}-linux-x86_64_v2-gnu
128
+
129
+ RUN mkdir -p /install-amd64/usr/lib /install-arm64/usr/lib
130
+ RUN mv $(uv python dir)/cpython-*-linux-aarch64-gnu/ /install-arm64/usr/local
131
+ RUN mv $(uv python dir)/cpython-*-linux-x86_64_v2-gnu/ /install-amd64/usr/local
132
+
123
133
# Fetch the runtime dependencies debs for both architectures
124
134
RUN \
125
135
--mount=type=cache,target=/var/cache/apt,sharing=locked \
@@ -129,8 +139,9 @@ RUN \
129
139
mkdir -p /tmp/debs-${arch} && \
130
140
cd /tmp/debs-${arch} && \
131
141
apt-get download \
132
- curl:${arch} \
133
142
gosu:${arch} \
143
+ zlib1g:${arch} \
144
+ libstdc++6:${arch} \
134
145
libjpeg62-turbo:${arch} \
135
146
libpq5:${arch} \
136
147
libwebp7:${arch} \
@@ -157,7 +168,7 @@ RUN \
157
168
# ## Stage 3: runtime
158
169
# ##
159
170
160
- FROM docker .io/library/python:${PYTHON_VERSION}-slim-${DEBIAN_VERSION}
171
+ FROM gcr .io/distroless/base-nossl-debian${DEBIAN_VERSION_NUMERIC}:debug
161
172
162
173
ARG TARGETARCH
163
174
@@ -176,4 +187,4 @@ EXPOSE 8008/tcp 8009/tcp 8448/tcp
176
187
ENTRYPOINT ["/start.py" ]
177
188
178
189
HEALTHCHECK --start-period=5s --interval=15s --timeout=5s \
179
- CMD curl -fSs http://localhost:8008/health || exit 1
190
+ CMD wget --quiet --tries=1 --spider http://localhost:8008/health || exit 1
0 commit comments