Skip to content

Instantly share code, notes, and snippets.

@russelltsherman
Forked from carlosedp/Dockerfile.base
Created September 18, 2020 13:15
Show Gist options
  • Select an option

  • Save russelltsherman/d10489472dfb8573d10e0569804053f3 to your computer and use it in GitHub Desktop.

Select an option

Save russelltsherman/d10489472dfb8573d10e0569804053f3 to your computer and use it in GitHub Desktop.

Revisions

  1. @carlosedp carlosedp revised this gist May 10, 2019. No changes.
  2. @carlosedp carlosedp created this gist May 10, 2019.
    21 changes: 21 additions & 0 deletions Dockerfile.base
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    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
    5 changes: 5 additions & 0 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    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.
    7 changes: 7 additions & 0 deletions build.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    #!/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
    13 changes: 13 additions & 0 deletions image.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    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