From db04c200f0212f346dd8f2f34f58e1eccd600c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mariusz=20J=C3=B3zala?= <377355+jozala@users.noreply.github.com> Date: Thu, 24 Apr 2025 09:04:58 +0200 Subject: [PATCH] Keep publishing Docker labels in specific Docker Hub context (#126989) These labels are incompatible with the Docker Hub, but for now we need to keep them to override the labels coming from the base image. --- distribution/docker/build.gradle | 2 +- distribution/docker/src/docker/Dockerfile.default | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/distribution/docker/build.gradle b/distribution/docker/build.gradle index f8b18251a4b7..2b9f3469bb4e 100644 --- a/distribution/docker/build.gradle +++ b/distribution/docker/build.gradle @@ -590,7 +590,7 @@ for (final Architecture architecture : Architecture.values()) { } if(base == DockerBase.DEFAULT) { // Add additional docker hub specific context which we use solely for publishing to docker hub. - // At the moment it only differs in not labels added that we need for openshift certification + // At the moment it is exactly the same as the default context. addBuildDockerContextTask(architecture, base, 'DockerHubContext', "docker-hub-build-context") } } diff --git a/distribution/docker/src/docker/Dockerfile.default b/distribution/docker/src/docker/Dockerfile.default index 9186a78cea51..47d4840e6169 100644 --- a/distribution/docker/src/docker/Dockerfile.default +++ b/distribution/docker/src/docker/Dockerfile.default @@ -139,7 +139,6 @@ LABEL org.label-schema.build-date="${build_date}" \\ org.opencontainers.image.vendor="Elastic" \\ org.opencontainers.image.version="${version}" -<% if (docker_context != 'docker-hub-build-context') { %> LABEL name="Elasticsearch" \\ maintainer="infra@elastic.co" \\ vendor="Elastic" \\ @@ -147,7 +146,6 @@ LABEL name="Elasticsearch" \\ release="1" \\ summary="Elasticsearch" \\ description="You know, for search." -<% } %> RUN mkdir /licenses && ln LICENSE.txt /licenses/LICENSE