From Reddit
I'm happy about the progress Spring Boot has made on CDS support in the last year. However, their documentation about assembling container images has always suffered from a bit of draw-the-rest-of-the-owl syndrome and I think the current version is still at best redundant and at worst inconsistent. Namely, https://docs.spring.io/spring-boot/reference/packaging/container-images/dockerfiles.html doesn't really work with https://docs.spring.io/spring-boot/reference/packaging/class-data-sharing.html and doesn't even seem all that relevant now.
Perhaps buildpacks have a way of leveraging both segregated layering and CDS in a way that doesn't devolve into the default jarmode=tools extraction mode. But I can't use buildpacks and I'm not sure I'd really want to if I could, so all their "buildpacks do this for you" convenience just ends up being noise.
Comment From: mhalbritter
I'm not sure how the Reddit commenter came to the conclusion that dockerfiles "doesn't really work with CDS", as it is a 2 line change to get CDS working.
Nevertheless, I've added a complete dockerfile with CDS to the documentation, and also linked to it in the CDS howto.