Skip to content

Commit 94d0b30

Browse files
feat: use debian base image for java-library-generation (#3817)
This PR switches the base image of `java-library-generation` to `python-3.13.2-slim`, based on `debian-slim`. https://hub.docker.com/layers/library/python/3.13.2-slim/images/sha256-8feb1b384bf6755cd1a180d65ec065c742aa1602f026993c33475be6ade2fb2e Our image is an infrastructure image not meant to be used by our final users. This solves the ongoing "compatibility layer" problems previously caused by our [GLIBC compatibility layer](https://github.com/googleapis/sdk-platform-java/blob/b87fd5e1af37af01cff1a51e3e50efcf048a3c27/.cloudbuild/library_generation/library_generation.Dockerfile#L37-L55). For context on this change: [doc](https://docs.google.com/document/d/1wI5VZG5gMCkt4ZyvL6wbf2IeyJrY9pFthFVuAY1kfWw/edit?resourcekey=0-aIfwb5NHqpBlQnbYsD19qw&tab=t.0#heading=h.7xlry2sxrwzj)
1 parent 5977c1f commit 94d0b30

File tree

2 files changed

+5
-83
lines changed

2 files changed

+5
-83
lines changed

.cloudbuild/library_generation/library_generation.Dockerfile

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,7 @@ RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
3434
RUN cp "/root/.m2/repository/com/google/api/gapic-generator-java/${DOCKER_GAPIC_GENERATOR_VERSION}/gapic-generator-java-${DOCKER_GAPIC_GENERATOR_VERSION}.jar" \
3535
"./gapic-generator-java.jar"
3636

37-
FROM docker.io/library/alpine:3.21.2@sha256:56fa17d2a7e7f168a043a2712e63aed1f8543aeafdcee47c58dcffe38ed51099 as glibc-compat
38-
39-
RUN apk update && apk add git sudo
40-
# This SHA is the latest known-to-work version of this binary compatibility tool
41-
ARG GLIB_MUS_SHA=e94aca542e3ab08b42aa0b0d6e72478b935bb8e8
42-
WORKDIR /home
43-
44-
# Install compatibility layer to run glibc-based programs (such as the
45-
# grpc plugin).
46-
# Alpine, by default, only supports musl-based binaries, and there is no public
47-
# downloadable distribution of the grpc plugin that is Alpine (musl) compatible.
48-
# This is one of the recommended approaches to ensure glibc-compatibility
49-
# as per https://wiki.alpinelinux.org/wiki/Running_glibc_programs
50-
RUN git clone https://gitlab.com/manoel-linux1/GlibMus-HQ.git
51-
WORKDIR /home/GlibMus-HQ
52-
# We lock the tool to the latest known-to-work version
53-
RUN git checkout "${GLIB_MUS_SHA}"
54-
RUN chmod a+x compile-x86_64-alpine-linux.sh
55-
RUN sh compile-x86_64-alpine-linux.sh
56-
57-
FROM docker.io/library/python:3.13.2-alpine3.20@sha256:816feb29731cdee64b15b0ae91dd9f1cbc36765984ff8ea85a3d90f064417237 as final
37+
FROM docker.io/library/python:3.13.2-slim@sha256:6b3223eb4d93718828223966ad316909c39813dee3ee9395204940500792b740 as final
5838

5939
ARG OWLBOT_CLI_COMMITTISH=3a68a9c0de318784b3aefadcc502a6521b3f1bc5
6040
ARG PROTOC_VERSION=25.5
@@ -63,28 +43,10 @@ ENV HOME=/home
6343
ENV OS_ARCHITECTURE="linux-x86_64"
6444

6545
# install OS tools
66-
RUN apk update && apk add unzip curl rsync openjdk17 jq bash nodejs npm git
46+
RUN apt update && apt install -y curl unzip rsync jq nodejs npm git openjdk-17-jdk
6747

6848
SHELL [ "/bin/bash", "-c" ]
6949

70-
# Copy glibc shared objects to enable execution of the grpc plugin.
71-
# This list was obtained via `libtree -pvvv /grpc/*` in the final container as
72-
# well as inspecting the modifications done by compile-x86_64-alpine-linux.sh
73-
# in the glibc-compat stage using the `dive` command.
74-
COPY --from=glibc-compat /etc/libgcc* /etc/
75-
COPY --from=glibc-compat /lib64/ld-linux-x86-64.so.2 /lib64/
76-
COPY --from=glibc-compat /lib/GLIBCFAKE.so.0 /lib/
77-
COPY --from=glibc-compat /lib/ld-linux-x86-64.so.2 /lib/
78-
COPY --from=glibc-compat /lib/libpthread* /lib/
79-
COPY --from=glibc-compat /lib/libucontext* /lib/
80-
COPY --from=glibc-compat /lib/libc.* /lib/
81-
COPY --from=glibc-compat /usr/lib/libgcc* /usr/lib/
82-
COPY --from=glibc-compat /usr/lib/libstdc* /usr/lib/
83-
COPY --from=glibc-compat /usr/lib/libobstack* /usr/lib/
84-
COPY --from=glibc-compat /lib/libm.so.6 /usr/lib/
85-
COPY --from=glibc-compat /usr/lib/libucontext.so.1 /usr/lib/
86-
87-
8850
# copy source code
8951
COPY hermetic_build/common /src/common
9052
COPY hermetic_build/library_generation /src/library_generation
@@ -121,7 +83,6 @@ RUN git checkout "${OWLBOT_CLI_COMMITTISH}"
12183
RUN npm i && npm run compile && npm link
12284
RUN owl-bot copy-code --version
12385
RUN chmod o+rx $(which owl-bot)
124-
RUN apk del -r npm && apk cache clean
12586

12687
# copy the Java formatter
12788
COPY --from=ggj-build "/google-java-format.jar" "${HOME}"/.library_generation/google-java-format.jar

.cloudbuild/library_generation/library_generation_airlock.Dockerfile

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,8 @@ RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip
3434
RUN cp "/root/.m2/repository/com/google/api/gapic-generator-java/${DOCKER_GAPIC_GENERATOR_VERSION}/gapic-generator-java-${DOCKER_GAPIC_GENERATOR_VERSION}.jar" \
3535
"./gapic-generator-java.jar"
3636

37-
# 3.20.1
38-
FROM us-docker.pkg.dev/artifact-foundry-prod/docker-3p-trusted/alpine@sha256:dabf91b69c191a1a0a1628fd6bdd029c0c4018041c7f052870bb13c5a222ae76 as glibc-compat
39-
40-
RUN apk update && apk add git sudo
41-
# This SHA is the latest known-to-work version of this binary compatibility tool
42-
ARG GLIB_MUS_SHA=e94aca542e3ab08b42aa0b0d6e72478b935bb8e8
43-
WORKDIR /home
44-
45-
# Install compatibility layer to run glibc-based programs (such as the
46-
# grpc plugin).
47-
# Alpine, by default, only supports musl-based binaries, and there is no public
48-
# downloadable distribution of the grpc plugin that is Alpine (musl) compatible.
49-
# This is one of the recommended approaches to ensure glibc-compatibility
50-
# as per https://wiki.alpinelinux.org/wiki/Running_glibc_programs
51-
RUN git clone https://gitlab.com/manoel-linux1/GlibMus-HQ.git
52-
WORKDIR /home/GlibMus-HQ
53-
# We lock the tool to the latest known-to-work version
54-
RUN git checkout "${GLIB_MUS_SHA}"
55-
RUN chmod a+x compile-x86_64-alpine-linux.sh
56-
RUN sh compile-x86_64-alpine-linux.sh
57-
58-
# 3.12.7-alpine3.20
59-
FROM us-docker.pkg.dev/artifact-foundry-prod/docker-3p-trusted/python@sha256:b83d5ec7274bee17d2f4bd0bfbb082f156241e4513f0a37c70500e1763b1d90d as final
37+
# 3.12.3-slim-bookworm
38+
FROM us-docker.pkg.dev/artifact-foundry-prod/docker-3p-trusted/python@sha256:afc139a0a640942491ec481ad8dda10f2c5b753f5c969393b12480155fe15a63 as final
6039

6140
ARG OWLBOT_CLI_COMMITTISH=3a68a9c0de318784b3aefadcc502a6521b3f1bc5
6241
ARG PROTOC_VERSION=25.5
@@ -65,27 +44,10 @@ ENV HOME=/home
6544
ENV OS_ARCHITECTURE="linux-x86_64"
6645

6746
# install OS tools
68-
RUN apk update && apk add unzip curl rsync openjdk17 jq bash nodejs npm git
47+
RUN apt update && apt install -y curl unzip rsync jq nodejs npm git openjdk-17-jdk
6948

7049
SHELL [ "/bin/bash", "-c" ]
7150

72-
# Copy glibc shared objects to enable execution of the grpc plugin.
73-
# This list was obtained via `libtree -pvvv /grpc/*` in the final container as
74-
# well as inspecting the modifications done by compile-x86_64-alpine-linux.sh
75-
# in the glibc-compat stage using the `dive` command.
76-
COPY --from=glibc-compat /etc/libgcc* /etc/
77-
COPY --from=glibc-compat /lib64/ld-linux-x86-64.so.2 /lib64/
78-
COPY --from=glibc-compat /lib/GLIBCFAKE.so.0 /lib/
79-
COPY --from=glibc-compat /lib/ld-linux-x86-64.so.2 /lib/
80-
COPY --from=glibc-compat /lib/libpthread* /lib/
81-
COPY --from=glibc-compat /lib/libucontext* /lib/
82-
COPY --from=glibc-compat /lib/libc.* /lib/
83-
COPY --from=glibc-compat /usr/lib/libgcc* /usr/lib/
84-
COPY --from=glibc-compat /usr/lib/libstdc* /usr/lib/
85-
COPY --from=glibc-compat /usr/lib/libobstack* /usr/lib/
86-
COPY --from=glibc-compat /lib/libm.so.6 /usr/lib/
87-
88-
8951
# copy source code
9052
COPY hermetic_build/common /src/common
9153
COPY hermetic_build/library_generation /src/library_generation
@@ -122,7 +84,6 @@ RUN git checkout "${OWLBOT_CLI_COMMITTISH}"
12284
RUN npm i && npm run compile && npm link
12385
RUN owl-bot copy-code --version
12486
RUN chmod o+rx $(which owl-bot)
125-
RUN apk del -r npm && apk cache clean
12687

12788
# copy the Java formatter
12889
COPY --from=ggj-build "/google-java-format.jar" "${HOME}"/.library_generation/google-java-format.jar

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy