Created
June 24, 2024 09:56
-
-
Save johnfosborneiii/ad2bf3d63199a19416aa281f2e5f1de0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM cgr.dev/chainguard/jdk:latest-dev AS chainguard-builder | |
USER 0 | |
# Add nginx and cosign packages to JRE distroless image | |
ARG PACKAGES="nginx cosign" | |
RUN mkdir -p /newroot/etc && \ | |
cp -a /etc/apk /newroot/etc && \ | |
apk update && \ | |
apk add --no-cache --initdb --root /newroot $PACKAGES && \ | |
find /newroot -mindepth 1 -maxdepth 1 -type d \( ! -name usr -a ! -name var \) -exec rm -rf {} + && \ | |
rm -rf /newroot/usr/share* && \ | |
rm -rf /newroot/var/log* && \ | |
rm -rf /newroot/var/spool* && \ | |
rm -rf /newroot/var/cache/* | |
FROM cgr.dev/chainguard/jre:latest | |
COPY --chown=65532:65532 --from=chainguard-builder /newroot / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment