Skip to content

Commit 1b57f55

Browse files
committed
Revert "Use python distroless instead of copying python into google distroless, as 2F scanning does not like that for some reason (#5)"
This reverts commit df7d12b.
1 parent 87dbc02 commit 1b57f55

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

build/Dockerfile.distroless

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# This is our strategy for getting a clean (from CVE perspective) base image for python-based services.
2+
# This mostly takes from https://github.com/alexdmoss/distroless-python
3+
# We need to build our own to be able to get new debian versions with fixes.
4+
5+
# Google periodically updates distroless images but just uses latest
6+
# CVEs will typically get fixed in versions (e.g deb12u7) and we'll need to rebuild this to incorporate them.
7+
ARG GOOGLE_DISTROLESS_BASE_IMAGE=gcr.io/distroless/cc-debian12:latest
8+
19
# ARG instructions do not create additional layers. Instead, next layers will
210
# concatenate them. Also, we have to repeat ARG instructions in each build
311
# stage that uses them.
@@ -176,7 +184,7 @@ COPY build/fonts.conf /etc/fonts/conf.d/100-gotenberg.conf
176184
# ----------------------------------------------
177185
# Final stage
178186
# ----------------------------------------------
179-
FROM public.ecr.aws/j9h1x6x3/distroless-python:latest AS base
187+
FROM ${GOOGLE_DISTROLESS_BASE_IMAGE} AS base
180188

181189
# Set platform-specific CHIPSET_ARCH
182190
FROM base AS base-amd64
@@ -190,6 +198,11 @@ ARG CHIPSET_ARCH=aarch64-linux-gnu
190198
ARG TARGETARCH
191199
FROM base-${TARGETARCH}
192200

201+
# Required for unoconverter
202+
COPY --from=gotenberg-binary-stage /usr/bin/python /usr/bin/python
203+
COPY --from=gotenberg-binary-stage /usr/lib/python3 /usr/lib/python3
204+
COPY --from=gotenberg-binary-stage /usr/lib/python3.11 /usr/lib/python3.11
205+
193206
ENV PYTHONPATH="/usr/local/lib/python3.11/dist-packages:"
194207

195208
# LibreOffice dependencies

0 commit comments

Comments
 (0)