From 134aae34b6b7cfe8a40cf4672c4a43d0da2b48f4 Mon Sep 17 00:00:00 2001 From: Lucy Linder Date: Mon, 3 Oct 2022 14:40:24 +0200 Subject: [PATCH] Honour DOCKER_CONFIG env var in jib the same way as in jib-core Support for DOCKER_CONFIG has been added in #27460. However, in jib, the DOCKER_CONFIG should point to a directory containing a `config.json`, while in the quarkus implementation it must point to the `config.json` file itself. This is very confusing, especially since there is no documentation. This commit fixes the `JibProcessor`, so it behave exactly as described in the jib documentation (see https://github.com/GoogleContainerTools/jib/blob/master/jib-maven-plugin/README.md#authentication-methods). That is, if `DOCKER_CONFIG` is set, it is expected to point to a folder with a `config.json` file. To keep backward compatibility, if `DOCKER_CONFIG` points to a file, it will be left untouched. See also `com.google.cloud.tools.jib.plugins.common.DefaultCredentialRetrievers.java`. --- .../container/image/jib/deployment/JibProcessor.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java index b2a716c6a2dd8d..989a4026e6306d 100644 --- a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java +++ b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java @@ -335,7 +335,13 @@ private RegistryImage toRegistryImage(ImageReference imageReference, Optional