From c7037889ca21b943a1a56527ab2f95c2e5c245d8 Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Tue, 16 Jul 2024 12:54:08 -0500 Subject: [PATCH 1/2] Squash layers in csharp v26.1 plugin --- plugins/protocolbuffers/csharp/v26.1/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/protocolbuffers/csharp/v26.1/Dockerfile b/plugins/protocolbuffers/csharp/v26.1/Dockerfile index de1ca4b31..71fbbc900 100644 --- a/plugins/protocolbuffers/csharp/v26.1/Dockerfile +++ b/plugins/protocolbuffers/csharp/v26.1/Dockerfile @@ -18,7 +18,10 @@ RUN bazel build '//:protoc_lib' COPY --link BUILD csharp.cc plugins/ RUN bazel build '//plugins:protoc-gen-csharp.stripped' -FROM gcr.io/distroless/cc-debian12:latest@sha256:e6ae66a5a343d7112167f9117c4e630cfffcd80db44e44302759ec13ddd2d22b +FROM gcr.io/distroless/cc-debian12:latest@sha256:e1065a1d58800a7294f74e67c32ec4146d09d6cbe471c1fa7ed456b2d2bf06e0 AS base + +FROM scratch +COPY --from=base --link / / COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-csharp . USER nobody ENTRYPOINT ["/protoc-gen-csharp"] From 0fada4cbba3dfe7ac8435230582a0503bce15107 Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Tue, 16 Jul 2024 12:57:55 -0500 Subject: [PATCH 2/2] Squash layers in js plugin too --- plugins/protocolbuffers/js/v3.21.4/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/protocolbuffers/js/v3.21.4/Dockerfile b/plugins/protocolbuffers/js/v3.21.4/Dockerfile index 6e58a560b..3f1ea1745 100644 --- a/plugins/protocolbuffers/js/v3.21.4/Dockerfile +++ b/plugins/protocolbuffers/js/v3.21.4/Dockerfile @@ -12,7 +12,10 @@ RUN arch=${TARGETARCH}; \ && tar zxf protobuf-javascript.tar.gz bin/protoc-gen-js \ && rm -f protobuf-javascript.tar.gz -FROM gcr.io/distroless/cc-debian12:latest@sha256:3b75fdd33932d16e53a461277becf57c4f815c6cee5f6bc8f52457c095e004c8 +FROM gcr.io/distroless/cc-debian12:latest@sha256:3b75fdd33932d16e53a461277becf57c4f815c6cee5f6bc8f52457c095e004c8 AS base + +FROM scratch +COPY --from=base --link / / COPY --from=build --link --chmod=0755 /tmp/bin/protoc-gen-js . USER nobody ENTRYPOINT ["/protoc-gen-js"]