Creating Class Data Sharing (CDS) archive with distroless

46 views
Skip to first unread message

Simon Klakegg

unread,
Sep 17, 2025, 1:38:17 AM9/17/25
to Distroless Users
Hey, following the discussion here: https://github.com/GoogleContainerTools/distroless/issues/1846 

I am trying to build CDS in our docker action using gcr.io/distroless/java-base-debian12 and the JRE required by our runtime. CDS seem to be very strict about this. Problem I am now facing, is highlighted in the post:

A lot of our apps fail during cds generation, since we do not set up the full env (which is fine).
However, without a shell in the FROM image, we can not used || true to suppress the exit code 1 in Dockerfile.
Any good idea how to solve this?

Andrew Latham

unread,
Sep 17, 2025, 12:05:54 PM9/17/25
to distrole...@googlegroups.com
Simon

So the Java command is the problem not Distroless or Docker. Do you
need to configure -Xlog: for stdout and stderr via some ENV first and
drop the or( || ) to true operator?

You may need to reach out for some Java assistance. Distroless and
minimal images bring bad practices to the light which is what makes
them awesome.

If you want to quickly do testing and iterate this is what I use
https://github.com/lathama/slimimage/blob/main/Dockerfile for Python
things.
> --
> You received this message because you are subscribed to the Google Groups "Distroless Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to distroless-use...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/distroless-users/4f504fb3-1dbe-4c09-a324-04ed7c8ca073n%40googlegroups.com.



--
- Andrew "lathama" Latham -
Reply all
Reply to author
Forward
0 new messages