Skip to content

build: add distroless image variant#830

Open
roidelapluie wants to merge 1 commit into
prometheus:masterfrom
roidelapluie:roidelapluie/distroless
Open

build: add distroless image variant#830
roidelapluie wants to merge 1 commit into
prometheus:masterfrom
roidelapluie:roidelapluie/distroless

Conversation

@roidelapluie

Copy link
Copy Markdown
Member

The distroless image runs as nonroot (UID 65532) without a shell, reducing the attack surface compared to the eclipse-temurin-based image.

The distroless image runs as nonroot (UID 65532) without a shell,
reducing the attack surface compared to the eclipse-temurin-based image.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
@SuperQ

SuperQ commented Jun 5, 2026

Copy link
Copy Markdown
Member

I don't think this will actually build/publish since this repo doesn't use the common Makefile due to Java.

Comment thread Dockerfile.distroless
@@ -0,0 +1,36 @@
FROM eclipse-temurin:21-jdk-noble AS builder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I've updated to Java 25.

Comment thread Dockerfile.distroless
RUN mvn package \
&& mv target/cloudwatch_exporter-*-with-dependencies.jar /cloudwatch_exporter.jar

FROM gcr.io/distroless/java21-debian12:nonroot

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi debian12 images are unmaintained, please use a debian13 image

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants