Skip to content

Commit

Permalink
chore(deps): update docker.io/bitnami/keycloak docker tag to v25 - BR…
Browse files Browse the repository at this point in the history
…OKEN FOR AWS Wrapper (#152)
  • Loading branch information
renovate[bot] authored Aug 28, 2024
1 parent c21dad8 commit 8470b39
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/utils/get_aws_jdbc_wrapper_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ get_major_version() {

# Keycloak only started to reference the aws_jdbc_wrapper version starting with v24, defaulting a fixed version of the jdbc driver,
# this check also allow bumping minimal aws_jdbc_wrapper version for critical fixes
if [[ "$(get_major_version "$keycloak_version")" -lt "25" ]] ; then
echo "2.3.5" # fix https://github.com/keycloak/keycloak/issues/27290
if [[ "$(get_major_version "$keycloak_version")" -lt "26" ]] ; then
echo "2.3.9" # fix https://github.com/keycloak/keycloak/issues/27290
exit 0
fi

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ jobs:
- name: Start Test Environment
uses: ./.github/actions/compose
# TODO: revert this skip test once https://github.com/camunda/team-infrastructure-experience/issues/352 is fixed
if: ${{ !(matrix.runner_desc.keycloak_jdbc_driver == 'aws-wrapper:postgresql' && matrix.keycloak_version == 25) }}
with:
project_name: keycloak
env:
Expand Down Expand Up @@ -443,6 +445,8 @@ jobs:
pip install -r ./.github/scripts/integration/requirements.txt
- name: Test Environment
# TODO: revert this skip test once https://github.com/camunda/team-infrastructure-experience/issues/352 is fixed
if: ${{ !(matrix.runner_desc.keycloak_jdbc_driver == 'aws-wrapper:postgresql' && matrix.keycloak_version == 25) }}
run: python3 ./.github/scripts/integration/main.py

- name: Tear down Aurora PG (aws only)
Expand Down Expand Up @@ -548,7 +552,9 @@ jobs:
docker buildx imagetools create -t "${{ env.dockerhub_target_name }}:${semver_tag}" "${{ env.keycloak_image_name }}"
docker buildx imagetools create -t "${{ env.dockerhub_target_name }}:${base_image_tag}-${suffix_version}" "${{ env.keycloak_image_name }}"
if [ "$(./.github/scripts/utils/find_latest_keycloak.sh)" = "${{ matrix.keycloak_version }}" ]; then
: # TODO: revert this once KC 25 is fixed for wrapper (https://github.com/camunda/team-infrastructure-experience/issues/352)
: # if [ "$(./.github/scripts/utils/find_latest_keycloak.sh)" = "${{ matrix.keycloak_version }}" ]; then
if [ "24" = "${{ matrix.keycloak_version }}" ]; then
docker buildx imagetools create -t "${{ env.dockerhub_target_name }}:latest" "${{ env.keycloak_image_name }}"
fi
Expand Down
2 changes: 1 addition & 1 deletion .watch-latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# It is its only purpose.

# Note: When renovate alerts about a new version of keycloak, please follow the `DEVELOPER.md` new release procedure.
FROM docker.io/bitnami/keycloak:24
FROM docker.io/bitnami/keycloak:25
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ To start the image, run:
```bash
docker run --name mykeycloak -p 8443:8443 \
-e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=change_me \
docker.io/camunda/keycloak:24
docker.io/camunda/keycloak:25
```

Keycloak will start in production mode, using secured HTTPS communication and will be available at [https://localhost:8443](https://localhost:8443).
Expand Down Expand Up @@ -83,7 +83,7 @@ Don't forget to set the `serviceAccountName` of the deployment/statefulset to po
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:

```yaml
image: docker.io/camunda/keycloak:24
image: docker.io/camunda/keycloak:25
extraEnvVars:
- name: KEYCLOAK_EXTRA_ARGS
value: "--db-driver=software.amazon.jdbc.Driver --transaction-xa-enabled=false --log-level=INFO,software.amazon.jdbc:INFO"
Expand Down
86 changes: 86 additions & 0 deletions keycloak-25/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
ARG BASE_IMAGE_NAME="docker.io/bitnami/keycloak:25.0.4-debian-12-r1"
# List of all available images with associated sha: https://hub.docker.com/r/bitnami/keycloak/tags
# Note: use the global image digest to make this image platform agnostic (see: https://github.com/camunda/zeebe/pull/14186)
ARG BASE_IMAGE_DIGEST="sha256:c9569482317a4235d5a718743b1b57856efe14d973d2612c2b579ca60a5b6d4f"

# We use the identity image to copy the keycloak theme
FROM docker.io/camunda/identity:latest@sha256:9c20462da6d384ce7ab7d678a853903a7f5aa94626e1ba046eef45ca922f7da4 AS identity

# Building builder image
# hadolint ignore=DL3006
FROM ${BASE_IMAGE_NAME}@${BASE_IMAGE_DIGEST} AS builder
# use the .github/scripts/utils/get_aws_wrapper_version.sh keycloak-version script to get the value and pass it at build time
ARG AWS_JDBC_WRAPPER_VERSION

USER 0

# install maven (silence alert about version pinning of maven)
# hadolint ignore=DL3008
RUN mkdir /home/keycloak && chown keycloak /home/keycloak && \
apt-get update && apt-get install maven -y --no-install-recommends

COPY --from=identity /app/keycloak-theme/ /opt/bitnami/keycloak/themes/identity
RUN chown 1001:1000 -R /opt/bitnami/keycloak/themes

USER 1001

WORKDIR /home/keycloak

# download the wrapper from github, then fetch the dependencies from maven
ADD --chown=1001:1000 --chmod=0644 "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"
ADD --chown=1001:1000 --chmod=0644 "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

# Install the custom providers
RUN cat /home/keycloak/pom.xml && mvn install && \
cp /home/keycloak/.m2/repository/software/amazon/*/*/*/*.jar /opt/bitnami/keycloak/providers/ && \
ls -alh /opt/bitnami/keycloak/providers/

RUN /opt/bitnami/keycloak/bin/kc.sh build

##### FINAL Keycloak IMAGE # ####

# hadolint ignore=DL3006
FROM ${BASE_IMAGE_NAME}@${BASE_IMAGE_DIGEST}
# leave the values below unset to use the default value at the top of the file
ARG BASE_IMAGE_NAME
ARG BASE_IMAGE_DIGEST

# use the .github/scripts/utils/get_aws_wrapper_version.sh keycloak-version script to get the value and pass it at build time
ARG AWS_JDBC_WRAPPER_VERSION

# Copy the previously built aws jdbc drivers
COPY --chown=1001:1000 --from=builder /opt/bitnami/keycloak/ /opt/bitnami/keycloak/

COPY --chown=1001:1000 --from=builder /opt/bitnami/keycloak/themes/identity /opt/bitnami/keycloak/themes/identity


# common, k8s, openshift and OCI labels:
# OCI: https://github.com/opencontainers/image-spec/blob/main/annotations.md
# OCP: https://docs.openshift.com/container-platform/4.10/openshift_images/create-images.html#defining-image-metadata
LABEL maintainer="Camunda" \
name="camunda/keycloak" \
summary="Keycloak bitnami with AWS wrapper" \
io.k8s.description="Keycloak bitnami with AWS wrapper." \
io.k8s.display-name="keycloak" \
description="Keycloak bitnami with AWS JDBC wrapper." \
jdbc.aws-jdbc-wrapper.version="${AWS_JDBC_WRAPPER_VERSION}" \
org.opencontainers.image.authors="Camunda" \
org.opencontainers.image.vendor="Camunda" \
org.opencontainers.image.documentation="https://hub.docker.com/camunda/keycloak/" \
org.opencontainers.image.licenses="Apache License 2.0" \
org.opencontainers.image.base.name="docker.io/library/${BASE_IMAGE_NAME}" \
org.opencontainers.image.base.digest="${BASE_IMAGE_DIGEST}" \
io.openshift.tags="bpmn,identity,keycloak,camunda,bitnami" \
io.openshift.min-memory="1Gi" \
io.openshift.min-cpu="1"

# cpu and ram allocation reference: https://www.keycloak.org/high-availability/concepts-memory-and-cpu-sizing

# the following labels are generated at buildtime - see https://github.com/docker/metadata-action
# org.opencontainers.image.title
# org.opencontainers.image.description
# org.opencontainers.image.url
# org.opencontainers.image.created
# org.opencontainers.image.revision
# org.opencontainers.image.source
# org.opencontainers.image.version

0 comments on commit 8470b39

Please sign in to comment.