Skip to content

Instantly share code, notes, and snippets.

@carlosedp
Last active September 18, 2020 13:15
Show Gist options
  • Save carlosedp/ef09c95b4ce88a79ea7d844f88a87a0f to your computer and use it in GitHub Desktop.
Save carlosedp/ef09c95b4ce88a79ea7d844f88a87a0f to your computer and use it in GitHub Desktop.
Build Keycloak on ARM

Hi Ed, here follows the files I used to build Keycloak.

The main Dockerfile is from their project where I just patch with my image and newer version.

Check the build.sh script.

#!/bin/bash
docker buildx build --platform linux/arm64,linux/amd64 -t carlosedp/jboss-base:8 -f Dockerfile.base . --push
git clone https://github.com/jboss-dockerfiles/keycloak.git
cd keycloak/server
patch -p1 < ../image.patch
docker buildx build --platform linux/arm64,linux/amd64 -t carlosedp/keycloak:v6.0.1 -f Dockerfile . --push
FROM centos:7
MAINTAINER Marek Goldmann <mgoldman@redhat.com>
# Install packages necessary to run EAP
RUN yum update -y && yum -y install xmlstarlet saxon augeas bsdtar unzip java-1.8.0-openjdk-devel && yum clean all
# Create a user and group used to launch processes
# The user ID 1000 is the default for the first "regular" user on Fedora/RHEL,
# so there is a high chance that this ID will be equal to the current user
# making it easier to use volumes (no permission issues)
RUN groupadd -r jboss -g 1000 && useradd -u 1000 -r -g jboss -m -d /opt/jboss -s /sbin/nologin -c "JBoss user" jboss && \
chmod 755 /opt/jboss
# Set the working directory to jboss' user home directory
WORKDIR /opt/jboss
# Specify the user which should be used to execute all commands below
USER jboss
# Set the JAVA_HOME variable to make it clear where Java is located
ENV JAVA_HOME /usr/lib/jvm/java
diff --git a/server/Dockerfile b/server/Dockerfile
index 64d836b..24861da 100644
--- a/server/Dockerfile
+++ b/server/Dockerfile
@@ -1,6 +1,6 @@
-FROM jboss/base-jdk:8
+FROM carlosedp/jboss-base:8
-ENV KEYCLOAK_VERSION 5.0.0
+ENV KEYCLOAK_VERSION 6.0.1
ENV JDBC_POSTGRES_VERSION 42.2.5
ENV JDBC_MYSQL_VERSION 5.1.46
ENV JDBC_MARIADB_VERSION 2.2.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment