Last active
February 11, 2023 14:31
-
-
Save dasgoll/9b21f6706e3022b23b5e0290e7a94fcf 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 adoptopenjdk/openjdk11:jdk-11.0.11_9-debian AS build-env | |
ENV KEYCLOAK_VERSION 17.0.1 | |
ARG KEYCLOAK_DIST=https://github.com/keycloak/keycloak/releases/download/$KEYCLOAK_VERSION/keycloak-$KEYCLOAK_VERSION.tar.gz | |
RUN apt-get install -y tar gzip | |
ADD $KEYCLOAK_DIST /tmp/keycloak/ | |
RUN (cd /tmp/keycloak && \ | |
tar -xvf /tmp/keycloak/keycloak-*.tar.gz && \ | |
rm /tmp/keycloak/keycloak-*.tar.gz) || true | |
RUN mv /tmp/keycloak/keycloak-* /opt/keycloak && mkdir -p /opt/keycloak/data | |
RUN chmod -R g+rwX /opt/keycloak | |
FROM adoptopenjdk/openjdk11:jdk-11.0.11_9-debian | |
COPY --from=build-env --chown=1000:0 /opt/keycloak /opt/keycloak | |
RUN echo "keycloak:x:0:root" >> /etc/group && \ | |
echo "keycloak:x:1000:0:keycloak user:/opt/keycloak:/sbin/nologin" >> /etc/passwd | |
USER 1000 | |
EXPOSE 8080 | |
EXPOSE 8443 | |
ENTRYPOINT [ "/opt/keycloak/bin/kc.sh" ] |
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
docker build . -t kc-debian | |
docker run --rm -it kc-debian start-dev | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment