diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..a82ce96 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +variables: + CONTAINER_NAME: thallian/keycloak + +build: + stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json + - >- + /kaniko/executor + --context "$CI_PROJECT_DIR" + --dockerfile "$CI_PROJECT_DIR/Dockerfile" + --destination "$CONTAINER_NAME:$CI_COMMIT_SHA" + --destination "$CONTAINER_NAME:$CI_COMMIT_REF_NAME" + --destination "$CONTAINER_NAME:latest" diff --git a/Containerfile b/Dockerfile similarity index 58% rename from Containerfile rename to Dockerfile index 45626b7..dd7d332 100644 --- a/Containerfile +++ b/Dockerfile @@ -1,27 +1,25 @@ -FROM docker.io/alpine:3.21 AS builder +FROM docker.io/alpine:3.16 AS builder -ENV VERSION=26.2.5 -ENV SHA256_SUM=e99e5f8783ea8f1cc04140b7033ea7291ff9898a088f37399b88651d81238f88 +ENV VERSION=19.0.1 +ENV SHA256_SUM=b1e9f89a6d02b9bf43848a970c69d94fb7e75c75fc8ebe2f69a1b7d2e0739733 RUN wget "https://github.com/keycloak/keycloak/releases/download/$VERSION/keycloak-$VERSION.tar.gz" RUN echo "$SHA256_SUM keycloak-$VERSION.tar.gz" | sha256sum -c - || exit 1 RUN mkdir -p /keycloak RUN tar xvf keycloak-$VERSION.tar.gz -C /keycloak --strip 1 -FROM docker.io/thallian/alpine-s6:3.21-3.2.0.2 - -ENV JAVA_OPTS_APPEND="-Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true" +FROM docker.io/thallian/alpine-s6:3.16 RUN addgroup -g 2222 keycloak RUN adduser -h /home/keycloak -u 2222 -D -G keycloak keycloak RUN apk add --no-cache \ - openjdk21-jre-headless \ + openjdk17-jre-headless \ bash COPY --from=builder --chown=keycloak:keycloak /keycloak /home/keycloak/server -RUN /home/keycloak/server/bin/kc.sh build --db=postgres --metrics-enabled=true +RUN /home/keycloak/server/bin/kc.sh build --db postgres RUN chown -R keycloak:keycloak /home/keycloak ADD /rootfs / diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index a8bfde8..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1 +0,0 @@ -multiarch_container() diff --git a/rootfs/etc/s6-overlay/s6-rc.d/keycloak/run b/rootfs/etc/s6-overlay/s6-rc.d/keycloak/run index fd9ed0c..f20d0da 100644 --- a/rootfs/etc/s6-overlay/s6-rc.d/keycloak/run +++ b/rootfs/etc/s6-overlay/s6-rc.d/keycloak/run @@ -8,4 +8,4 @@ exec s6-setuidgid keycloak /home/keycloak/server/bin/kc.sh start \ --db-password "$DB_PASSWORD" \ --hostname "$HOSTNAME" \ --http-enabled true \ - --proxy-headers xforwarded + --proxy edge