Skip to content

Commit

Permalink
Add more sophisticated docker example, rel #76
Browse files Browse the repository at this point in the history
  • Loading branch information
sschnabe committed Mar 2, 2024
1 parent fb20a34 commit 6eff3f3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- 21.0.2
- 21.1.2
- 22.0.5
- 23.0.1
- 23.0.7
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,39 @@ Check: [kokuwaio/keycloak](https://github.com/kokuwaio/keycloak)
Dockerfile:

```Dockerfile
FROM quay.io/keycloak/keycloak:21.0.1
###
### download keycloak event metrics
###

FROM debian:stable-slim AS metrics

RUN apt-get -qq update
RUN apt-get -qq install --yes --no-install-recommends ca-certificates wget

ARG METRICS_VERSION=1.0.0
ARG METRICS_FILE=keycloak-event-metrics-${METRICS_VERSION}.jar
ARG METRICS_URL=https://repo1.maven.org/maven2/io/kokuwa/keycloak/keycloak-event-metrics/${METRICS_VERSION}

RUN wget --quiet --no-hsts ${METRICS_URL}/${METRICS_FILE}
RUN wget --quiet --no-hsts ${METRICS_URL}/${METRICS_FILE}.sha1
RUN wget --quiet --no-hsts ${METRICS_URL}/${METRICS_FILE}.asc
RUN echo "$(cat ${METRICS_FILE}.sha1) ${METRICS_FILE}" sha1sum --quiet --check --strict -
RUN mkdir -p /opt/keycloak/providers
RUN mv ${METRICS_FILE} /opt/keycloak/providers

###
### build keycloak with metrics
###

FROM quay.io/keycloak/keycloak:23.0.7

ENV KEYCLOAK_ADMIN=admin
ENV KEYCLOAK_ADMIN_PASSWORD=password
ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true
ENV KC_LOG_CONSOLE_COLOR=true

ADD target/keycloak-event-metrics-0.0.1-SNAPSHOT.jar /opt/keycloak/providers
COPY --from=metrics /opt/keycloak/providers /opt/keycloak/providers
RUN /opt/keycloak/bin/kc.sh build
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
</execution>
</executions>
</plugin>

<!-- flatten fails because of groupId ${ee.maven.groupId} - skip -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down

0 comments on commit 6eff3f3

Please sign in to comment.