Skip to content

Commit c5d3ad0

Browse files
authored
feat: built muti platform keycloak dev images (#6)
Signed-off-by: Hung-Han (Henry) Chen <[email protected]>
1 parent 2e55e66 commit c5d3ad0

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

.github/workflows/build_images.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
keycloak_version:
19+
- 26.0.7
1920
- 26.0.6
2021
- 25.0.6
2122
- 25.0.0
@@ -62,20 +63,35 @@ jobs:
6263
uses: actions/checkout@v3
6364
with:
6465
fetch-depth: 0
66+
67+
- name: Set up QEMU
68+
uses: docker/setup-qemu-action@v3
69+
with:
70+
platforms: all
71+
72+
- name: Set up Docker Buildx
73+
uses: docker/setup-buildx-action@v3
74+
6575
- uses: docker/login-action@v2
6676
with:
6777
registry: ${{ env.REGISTRY }}
6878
username: ${{ github.actor }}
6979
password: ${{ secrets.GITHUB_TOKEN }}
80+
7081
- name: Extract metadata (tags, labels) for Docker
7182
id: meta
7283
uses: docker/metadata-action@v4
7384
with:
7485
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
86+
7587
- uses: docker/build-push-action@v4
7688
with:
7789
context: .
7890
file: ./Dockerfile
91+
platforms:
92+
- linux/amd64
93+
- linux/arm64
94+
- linux/arm
7995
push: true
8096
build-args: |
8197
"KEYCLOAK_VERSION=${{ matrix.keycloak_version }}"

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# syntax=docker/dockerfile:1
22

3-
# Keyclaok base image version, set with --build-arg="KEYCLOAK_VERSION=..."
3+
# Keycloak base image version, set with --build-arg="KEYCLOAK_VERSION=..."
44
ARG KEYCLOAK_VERSION
5+
ARG TARGETPLATFORM
56

67
# See "Installing additional RPM packages" https://www.keycloak.org/server/containers
7-
FROM registry.access.redhat.com/ubi9 AS ubi-micro-build
8-
ARG DEV_DEPENDECIES="tar gzip util-linux"
8+
FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9 AS ubi-micro-build
9+
10+
ARG DEV_DEPENDENCIES="tar gzip util-linux"
911
RUN mkdir -p /mnt/rootfs
1012
RUN dnf -y update
11-
RUN dnf install --installroot /mnt/rootfs ${DEV_DEPENDECIES} --releasever 9 --setopt install_weak_deps=false --nodocs -y && \
13+
RUN dnf install --installroot /mnt/rootfs ${DEV_DEPENDENCIES} --releasever 9 --setopt install_weak_deps=false --nodocs -y && \
1214
dnf --installroot /mnt/rootfs clean all && \
1315
rpm --root /mnt/rootfs -e --nodeps setup
1416

15-
FROM quay.io/keycloak/keycloak:${KEYCLOAK_VERSION}
17+
FROM --platform=$TARGETPLATFORM quay.io/keycloak/keycloak:${KEYCLOAK_VERSION}
1618
COPY --from=ubi-micro-build /mnt/rootfs /
1719

1820
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]

0 commit comments

Comments
 (0)