From a3d67a2b641399975d39a0c314254d0d4f8ba76e Mon Sep 17 00:00:00 2001 From: Steven Hawkins Date: Thu, 25 Apr 2024 05:48:13 -0400 Subject: [PATCH] fix: add / clean labels on community images (#28760) closes: #24414 Signed-off-by: Steve Hawkins --- operator/Dockerfile | 39 ++++++++++++++++++++++++++++++++++++ operator/pom.xml | 1 + quarkus/container/Dockerfile | 39 ++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) diff --git a/operator/Dockerfile b/operator/Dockerfile index 6145179ac6..93017bf576 100644 --- a/operator/Dockerfile +++ b/operator/Dockerfile @@ -19,3 +19,42 @@ USER 1000 WORKDIR /opt/keycloak ENTRYPOINT [ "java", "-Djava.util.logging.manager=org.jboss.logmanager.LogManager", "-jar", "quarkus-run.jar" ] + +# common labels +ARG KEYCLOAK_VERSION +ARG KEYCLOAK_URL="https://www.keycloak.org/" +ARG KEYCLOAK_TAGS="keycloak security identity" +ARG KEYCLOAK_MAINTAINER=${KEYCLOAK_URL} +ARG KEYCLOAK_VENDOR=${KEYCLOAK_MAINTAINER} + +LABEL maintainer=${KEYCLOAK_MAINTAINER} \ + vendor=${KEYCLOAK_VENDOR} \ + version=${KEYCLOAK_VERSION} \ + url=${KEYCLOAK_URL} \ + io.openshift.tags=${KEYCLOAK_TAGS} \ + release="" \ + vcs-ref="" \ + com.redhat.build-host="" \ + com.redhat.component="" \ + com.redhat.license_terms="" + +# operator specific +ARG KEYCLOAK_OPERATOR_DISPLAY_NAME="Keycloak Operator" +ARG KEYCLOAK_OPERATOR_IMAGE_NAME="keycloak-operator" +ARG KEYCLOAK_OPERATOR_DESCRIPTION="${KEYCLOAK_OPERATOR_DISPLAY_NAME} Image" + +LABEL name=${KEYCLOAK_OPERATOR_IMAGE_NAME} \ + description=${KEYCLOAK_OPERATOR_DESCRIPTION} \ + summary=${KEYCLOAK_OPERATOR_DESCRIPTION} \ + io.k8s.display-name=${KEYCLOAK_OPERATOR_DISPLAY_NAME} \ + io.k8s.description=${KEYCLOAK_OPERATOR_DESCRIPTION} + +# oci +ARG KEYCLOAK_SOURCE="https://github.com/keycloak/keycloak" +ARG KEYCLOAK_DOCS=${KEYCLOAK_URL}documentation + +LABEL org.opencontainers.image.title=${KEYCLOAK_OPERATOR_DISPLAY_NAME} \ + org.opencontainers.image.url=${KEYCLOAK_URL} \ + org.opencontainers.image.source=${KEYCLOAK_SOURCE} \ + org.opencontainers.image.description=${KEYCLOAK_DESCRIPTION} \ + org.opencontainers.image.documentation=${KEYCLOAK_DOCS} diff --git a/operator/pom.xml b/operator/pom.xml index a9dd746c85..329f0a9dfe 100644 --- a/operator/pom.xml +++ b/operator/pom.xml @@ -23,6 +23,7 @@ UTF-8 UTF-8 keycloak + ${project.version} diff --git a/quarkus/container/Dockerfile b/quarkus/container/Dockerfile index 846fbceb8b..3e980da892 100644 --- a/quarkus/container/Dockerfile +++ b/quarkus/container/Dockerfile @@ -38,3 +38,42 @@ EXPOSE 8443 EXPOSE 9000 ENTRYPOINT [ "/opt/keycloak/bin/kc.sh" ] + +# common labels +ARG KEYCLOAK_VERSION +ARG KEYCLOAK_URL="https://www.keycloak.org/" +ARG KEYCLOAK_TAGS="keycloak security identity" +ARG KEYCLOAK_MAINTAINER=${KEYCLOAK_URL} +ARG KEYCLOAK_VENDOR=${KEYCLOAK_MAINTAINER} + +LABEL maintainer=${KEYCLOAK_MAINTAINER} \ + vendor=${KEYCLOAK_VENDOR} \ + version=${KEYCLOAK_VERSION} \ + url=${KEYCLOAK_URL} \ + io.openshift.tags=${KEYCLOAK_TAGS} \ + release="" \ + vcs-ref="" \ + com.redhat.build-host="" \ + com.redhat.component="" \ + com.redhat.license_terms="" + +# server specific +ARG KEYCLOAK_SERVER_DISPLAY_NAME="Keycloak Server" +ARG KEYCLOAK_SERVER_IMAGE_NAME="keycloak" +ARG KEYCLOAK_SERVER_DESCRIPTION="${KEYCLOAK_SERVER_DISPLAY_NAME} Image" + +LABEL name=${KEYCLOAK_SERVER_IMAGE_NAME} \ + description=${KEYCLOAK_SERVER_DESCRIPTION} \ + summary=${KEYCLOAK_SERVER_DESCRIPTION} \ + io.k8s.display-name=${KEYCLOAK_SERVER_DISPLAY_NAME} \ + io.k8s.description=${KEYCLOAK_SERVER_DESCRIPTION} + +# oci +ARG KEYCLOAK_SOURCE="https://github.com/keycloak/keycloak" +ARG KEYCLOAK_DOCS=${KEYCLOAK_URL}documentation + +LABEL org.opencontainers.image.title=${KEYCLOAK_SERVER_DISPLAY_NAME} \ + org.opencontainers.image.url=${KEYCLOAK_URL} \ + org.opencontainers.image.source=${KEYCLOAK_SOURCE} \ + org.opencontainers.image.description=${KEYCLOAK_DESCRIPTION} \ + org.opencontainers.image.documentation=${KEYCLOAK_DOCS}