diff --git a/extensions/container-image/container-image-buildpack/deployment/src/main/java/io/quarkus/container/image/buildpack/deployment/BuildpackProcessor.java b/extensions/container-image/container-image-buildpack/deployment/src/main/java/io/quarkus/container/image/buildpack/deployment/BuildpackProcessor.java index 6c31164b28f8c..f71b42db28538 100644 --- a/extensions/container-image/container-image-buildpack/deployment/src/main/java/io/quarkus/container/image/buildpack/deployment/BuildpackProcessor.java +++ b/extensions/container-image/container-image-buildpack/deployment/src/main/java/io/quarkus/container/image/buildpack/deployment/BuildpackProcessor.java @@ -42,6 +42,8 @@ public class BuildpackProcessor { private static final Logger log = Logger.getLogger(BuildpackProcessor.class); + private static final String QUARKUS_CONTAINER_IMAGE_BUILD = "QUARKUS_CONTAINER_IMAGE_BUILD"; + private static final String QUARKUS_CONTAINER_IMAGE_PUSH = "QUARKUS_CONTAINER_IMAGE_PUSH"; public static final String BUILDPACK = "buildpack"; @@ -160,11 +162,15 @@ private String runBuildpackBuild(BuildpackConfig buildpackConfig, String targetImageName = containerImage.getImage().toString(); log.debug("Using Destination image of " + targetImageName); - Map envMap = buildpackConfig.builderEnv; + Map envMap = new HashMap<>(buildpackConfig.builderEnv); if (!envMap.isEmpty()) { log.info("Using builder environment of " + envMap); } + // Let's explicitly disable build and push during the build to avoid inception style builds + envMap.put(QUARKUS_CONTAINER_IMAGE_BUILD, "false"); + envMap.put(QUARKUS_CONTAINER_IMAGE_PUSH, "false"); + log.info("Initiating Buildpack build"); Buildpack buildpack = Buildpack.builder() .addNewFileContent(dirs.get(ProjectDirs.ROOT).toFile())