Skip to content

Commit 942d1df

Browse files
authored
feat(keycloak): v24 (#53)
closes #51
1 parent cb6be03 commit 942d1df

File tree

6 files changed

+103
-18
lines changed

6 files changed

+103
-18
lines changed

.github/renovate.json5

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
":dependencyDashboard",
55
":semanticCommits",
66
":enablePreCommit",
7-
":docker"
7+
":docker",
88
],
99
"automerge": false,
1010
"packageRules": [
@@ -16,7 +16,7 @@
1616
"matchFileNames": [".watch-latest/Dockerfile"],
1717
"matchUpdateTypes": ["major"],
1818
"enabled": true,
19-
"addLabels": ["dependencies", "docker"]
19+
"addLabels": ["dependencies", "docker", "hold"],
2020
},
2121
{
2222
"matchManagers": ["dockerfile"],
@@ -26,14 +26,14 @@
2626
"matchFileNames": ["keycloak-*/Dockerfile"],
2727
"versioning": "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)(:?-(?<compatibility>.+)(?<build>\\d+)-r(?<revision>\\d+))?$",
2828
"enabled": true,
29-
"addLabels": ["dependencies", "docker"]
29+
"addLabels": ["dependencies", "docker"],
3030
},
3131
{
3232
"matchManagers": ["dockerfile"],
3333
"matchDatasources": ["docker"],
3434
"matchFileNames": ["keycloak-*/Dockerfile"],
3535
"matchUpdateTypes": ["major"],
36-
"enabled": false
37-
}
36+
"enabled": false,
37+
},
3838
]
3939
}

.github/workflows/build-images.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,23 @@ jobs:
272272
secret/data/products/infrastructure-experience/ci/common AURORA_POSTGRESQL_PASSWORD | postgres_superuser_password;
273273
secret/data/products/infrastructure-experience/ci/common AURORA_POSTGRESQL_USERNAME | postgres_superuser;
274274
275+
secret/data/products/infrastructure-experience/ci/common DOCKERHUB_USER;
276+
secret/data/products/infrastructure-experience/ci/common DOCKERHUB_PASSWORD;
277+
278+
- name: Login to the dockerhub registry # prevents pull limit rate
279+
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3
280+
with:
281+
registry: "${{ vars.CONTAINER_REGISTRY }}"
282+
username: "${{ steps.secrets.outputs.DOCKERHUB_USER }}"
283+
password: "${{ steps.secrets.outputs.DOCKERHUB_PASSWORD }}"
284+
285+
- name: Login to the registry
286+
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3
287+
with:
288+
registry: ${{ vars.CONTAINER_REGISTRY_CI }}
289+
username: ${{ steps.secrets.outputs.MACHINE_USR }}
290+
password: ${{ steps.secrets.outputs.MACHINE_PWD }}
291+
275292
- name: Compute AWS variables
276293
if: startsWith(matrix.runner_desc.runner, 'aws')
277294
run: |
@@ -329,13 +346,6 @@ jobs:
329346
echo "postgres_host=${postgres_host}" >> "$GITHUB_ENV"
330347
echo "postgres_host=${postgres_host}"
331348
332-
- name: Login to the registry
333-
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3
334-
with:
335-
registry: ${{ vars.CONTAINER_REGISTRY_CI }}
336-
username: ${{ steps.secrets.outputs.MACHINE_USR }}
337-
password: ${{ steps.secrets.outputs.MACHINE_PWD }}
338-
339349
# The self-hosted runner doesn't provide a postgres client and the prerequisites for make,
340350
# so we need to install them manually
341351
- name: Install required packages
@@ -402,9 +412,9 @@ jobs:
402412
KEYCLOAK_JDBC_PARAMS: "${{ matrix.runner_desc.keycloak_db_jdbc_query }}"
403413
KC_DB_DRIVER: "${{ matrix.runner_desc.keycloak_db_driver }}"
404414

405-
KEYCLOAK_LOG_LEVEL: "INFO,software.amazon.jdbc:FINEST"
415+
KEYCLOAK_LOG_LEVEL: "INFO,software.amazon.jdbc:INFO"
406416

407-
COMPOSE_POSTGRES_IMAGE: "public.ecr.aws/docker/library/postgres:${{ env.postgres_version }}"
417+
COMPOSE_POSTGRES_IMAGE: "docker.io/postgres:${{ env.postgres_version }}"
408418
COMPOSE_POSTGRES_DEPLOY_REPLICAS: "${{ matrix.runner_desc.postgres_replicas }}"
409419
COMPOSE_KEYCLOAK_DEPENDS_ON: "${{ env.compose_keycloak_depends_on }}"
410420
COMPOSE_KEYCLOAK_VOLUME_1: "${{ env.compose_keycloak_volume_1 || '/dev/null:/dummynull1' }}"

.watch-latest/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# It is its only purpose.
33

44
# Note: When renovate alerts about a new version of keycloak, please follow the `DEVELOPER.md` new release procedure.
5-
FROM docker.io/bitnami/keycloak:23
5+
FROM docker.io/bitnami/keycloak:24

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To start the image, run:
2424
```bash
2525
docker run --name mykeycloak -p 8443:8443 \
2626
-e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=change_me \
27-
docker.io/camunda/keycloak:23
27+
docker.io/camunda/keycloak:24
2828
```
2929

3030
Keycloak will start in production mode, using secured HTTPS communication and will be available at [https://localhost:8443](https://localhost:8443).
@@ -81,7 +81,7 @@ Don't forget to set the `serviceAccountName` of the deployment/statefulset to po
8181
To use this image in the Helm chart [bitnami/keycloak](https://artifacthub.io/packages/helm/bitnami/keycloak), update the image used and add the necessary extra environment variables:
8282

8383
```yaml
84-
image: docker.io/camunda/keycloak:23
84+
image: docker.io/camunda/keycloak:24
8585
extraEnvVars:
8686
- name: KEYCLOAK_EXTRA_ARGS
8787
value: "--db-driver=software.amazon.jdbc.Driver --transaction-xa-enabled=false --log-level=INFO,software.amazon.jdbc:INFO"

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ volumes:
66

77
services:
88
postgres:
9-
image: ${COMPOSE_POSTGRES_IMAGE:-public.ecr.aws/docker/library/postgres:latest}
9+
image: ${COMPOSE_POSTGRES_IMAGE:-docker.io/postgres:latest}
1010
volumes:
1111
- postgres_data:/var/lib/postgresql/data
1212
environment:

keycloak-24/Dockerfile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
ARG BASE_IMAGE_NAME="docker.io/bitnami/keycloak:24.0.2-debian-12-r0"
2+
# List of all available images with associated sha: https://hub.docker.com/r/bitnami/keycloak/tags
3+
# Note: use the global image digest to make this image platform agnostic (see: https://github.com/camunda/zeebe/pull/14186)
4+
ARG BASE_IMAGE_DIGEST="sha256:c597a98f26fc4e7ab9a2e2a555113c8b91b8018f66946cc77a4224f1e595c95e"
5+
6+
# Building builder image
7+
# hadolint ignore=DL3006
8+
FROM ${BASE_IMAGE_NAME}@${BASE_IMAGE_DIGEST} as builder
9+
# use the .github/scripts/utils/get_aws_wrapper_version.sh keycloak-version script to get the value and pass it at build time
10+
ARG AWS_JDBC_WRAPPER_VERSION
11+
12+
USER 0
13+
14+
# install maven (silence alert about version pinning of maven)
15+
# hadolint ignore=DL3008
16+
RUN mkdir /home/keycloak && chown keycloak /home/keycloak && \
17+
apt-get update && apt-get install maven -y --no-install-recommends
18+
19+
USER 1001
20+
21+
WORKDIR /home/keycloak
22+
23+
# download the wrapper from github, then fetch the dependencies from maven
24+
ADD --chown=1001 "https://github.com/awslabs/aws-advanced-jdbc-wrapper/releases/download/${AWS_JDBC_WRAPPER_VERSION}/aws-advanced-jdbc-wrapper-${AWS_JDBC_WRAPPER_VERSION}.jar" "/opt/bitnami/keycloak/providers/aws-advanced-jdbc-wrapper-${AWS_JDBC_WRAPPER_VERSION}.jar"
25+
ADD --chown=1001 "https://repo1.maven.org/maven2/software/amazon/jdbc/aws-advanced-jdbc-wrapper/${AWS_JDBC_WRAPPER_VERSION}/aws-advanced-jdbc-wrapper-${AWS_JDBC_WRAPPER_VERSION}.pom" /home/keycloak/pom.xml
26+
27+
RUN cat /home/keycloak/pom.xml && mvn install && \
28+
cp /home/keycloak/.m2/repository/software/amazon/awssdk/*/*/*.jar /opt/bitnami/keycloak/providers/
29+
30+
RUN /opt/bitnami/keycloak/bin/kc.sh build
31+
32+
##### FINAL Keycloak IMAGE #####
33+
34+
# hadolint ignore=DL3006
35+
FROM ${BASE_IMAGE_NAME}@${BASE_IMAGE_DIGEST}
36+
# leave the values below unset to use the default value at the top of the file
37+
ARG BASE_IMAGE_NAME
38+
ARG BASE_IMAGE_DIGEST
39+
40+
# use the .github/scripts/utils/get_aws_wrapper_version.sh keycloak-version script to get the value and pass it at build time
41+
ARG AWS_JDBC_WRAPPER_VERSION
42+
43+
# Copy the previously built aws jdbc drivers
44+
COPY --from=builder /opt/bitnami/keycloak/ /opt/bitnami/keycloak/
45+
46+
# common, k8s, openshift and OCI labels:
47+
# OCI: https://github.com/opencontainers/image-spec/blob/main/annotations.md
48+
# OCP: https://docs.openshift.com/container-platform/4.10/openshift_images/create-images.html#defining-image-metadata
49+
LABEL maintainer="Camunda" \
50+
name="camunda/keycloak" \
51+
summary="Keycloak bitnami with AWS wrapper" \
52+
io.k8s.description="Keycloak bitnami with AWS wrapper." \
53+
io.k8s.display-name="keycloak" \
54+
description="Keycloak bitnami with AWS JDBC wrapper." \
55+
jdbc.aws-jdbc-wrapper.version="${AWS_JDBC_WRAPPER_VERSION}" \
56+
org.opencontainers.image.authors="Camunda" \
57+
org.opencontainers.image.vendor="Camunda" \
58+
org.opencontainers.image.documentation="https://hub.docker.com/camunda/keycloak/" \
59+
org.opencontainers.image.licenses="Apache License 2.0" \
60+
org.opencontainers.image.base.name="docker.io/library/${BASE_IMAGE_NAME}" \
61+
org.opencontainers.image.base.digest="${BASE_IMAGE_DIGEST}" \
62+
io.openshift.tags="bpmn,identity,keycloak,camunda,bitnami" \
63+
io.openshift.min-memory="1Gi" \
64+
io.openshift.min-cpu="1"
65+
66+
# cpu and ram allocation reference: https://www.keycloak.org/high-availability/concepts-memory-and-cpu-sizing
67+
68+
# the following labels are generated at buildtime - see https://github.com/docker/metadata-action
69+
# org.opencontainers.image.title
70+
# org.opencontainers.image.description
71+
# org.opencontainers.image.url
72+
# org.opencontainers.image.created
73+
# org.opencontainers.image.revision
74+
# org.opencontainers.image.source
75+
# org.opencontainers.image.version

0 commit comments

Comments
 (0)