11# #################################################
22# Step 1 - Build an optimized image
33# #################################################
4- FROM quay.io/keycloak/keycloak:20 .0.3 as builder
4+ FROM quay.io/keycloak/keycloak:24 .0.1 as builder
55
66# These options can be modified to produce a different
77# optimized build.
@@ -26,16 +26,25 @@ COPY themes/ /opt/keycloak/themes
2626RUN /opt/keycloak/bin/kc.sh build
2727
2828# #################################################
29- # Step 2 - Copy optimized build into running image
29+ # Step 2 - Add required dependencies
30+ # https://www.keycloak.org/server/containers
3031# #################################################
31- FROM quay.io/keycloak/keycloak:20.0.3
32+ FROM registry.access.redhat.com/ubi9 AS ubi-micro-build
33+ RUN mkdir -p /mnt/rootfs
3234
33- # parses ecs metadata
34- USER root
35- RUN microdnf update -y && \
36- microdnf install -y jq && \
37- microdnf clean all
35+ # curl and jq used to parse ecs metadata
36+ RUN dnf update -y && \
37+ dnf install --installroot /mnt/rootfs curl jq --releasever 9 --setopt install_weak_deps=false --nodocs -y && \
38+ dnf --installroot /mnt/rootfs clean all && \
39+ rpm --root /mnt/rootfs -e --nodeps setup
40+
41+ # ##################################################################
42+ # Step 3 - Copy optimized build and dependencies into running image
43+ # ##################################################################
44+ FROM quay.io/keycloak/keycloak:24.0.1
3845
46+ USER root
47+ COPY --from=ubi-micro-build /mnt/rootfs /
3948USER keycloak
4049COPY --from=builder /opt/keycloak /opt/keycloak
4150
0 commit comments