FROM alpine:3.15 AS builder ENV VERSION=18.0.0 ENV SHA256_SUM=c64318b3418a477bc7f431b44fa4e6d102d53c7ddea3433a31cf7f1d084c1a53 RUN wget "https://github.com/keycloak/keycloak/releases/download/$VERSION/keycloak-$VERSION.tar.gz" RUN echo "$SHA256_SUM keycloak-$VERSION.tar.gz" | sha256sum -c - || exit 1 RUN mkdir -p /keycloak RUN tar xvf keycloak-$VERSION.tar.gz -C /keycloak --strip 1 FROM thallian/alpine-s6:latest RUN addgroup -g 2222 keycloak RUN adduser -h /home/keycloak -u 2222 -D -G keycloak keycloak RUN apk add --no-cache \ openjdk17-jre-headless \ bash COPY --from=builder --chown=keycloak:keycloak /keycloak /home/keycloak/server RUN /home/keycloak/server/bin/kc.sh build --db postgres RUN chown -R keycloak:keycloak /home/keycloak ADD /rootfs /