{"record":{"id":"135ae2816fced56e","repo":"quarkusio/quarkus","slug":"unable-to-create-container-image","errorCode":null,"errorMessage":"Unable to create container image","messagePattern":"Unable to create container image","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java","lineNumber":273,"sourceCode":"        Containerizer containerizer = createContainerizer(containerImageConfig, jibConfig, containerImage, pushRequested);\n        for (String additionalTag : containerImage.getAdditionalTags()) {\n            containerizer.withAdditionalTag(additionalTag);\n        }\n\n        // Jib uses the Google HTTP Client under the hood which attempts to record traces via OpenCensus which is wired\n        // to delegate to OpenTelemetry.\n        // This can lead to problems with the Quarkus OpenTelemetry extension which expects Vert.x to be running,\n        // something that is not the case at build time, see https://github.com/quarkusio/quarkus/issues/22864.\n        try (var resettableSystemProperties = ResettableSystemProperties\n                .of(OPENTELEMETRY_CONTEXT_CONTEXT_STORAGE_PROVIDER_SYS_PROP, \"default\")) {\n            JibContainer container = containerizeUnderLock(jibContainerBuilder, containerizer);\n            log.infof(\"%s container image %s (%s)\\n\",\n                    containerImageConfig.isPushExplicitlyEnabled() ? \"Pushed\" : \"Created\",\n                    container.getTargetImage(),\n                    container.getDigest());\n            return container;\n        } catch (Exception e) {\n            throw new RuntimeException(\"Unable to create container image\", e);\n        }\n    }\n\n    private Containerizer createContainerizer(ContainerImageConfig containerImageConfig,\n            ContainerImageJibConfig jibConfig, ContainerImageInfoBuildItem containerImageInfo,\n            boolean pushRequested) {\n        Containerizer containerizer;\n        ImageReference imageReference = ImageReference.of(containerImageInfo.getRegistry().orElse(null),\n                containerImageInfo.getRepository(), containerImageInfo.getTag());\n\n        if (pushRequested || containerImageConfig.isPushExplicitlyEnabled()) {\n            if (imageReference.getRegistry() == null) {\n                log.info(\"No container image registry was set, so 'docker.io' will be used\");\n            }\n            RegistryImage registryImage = toRegistryImage(imageReference, containerImageConfig.username(),\n                    containerImageConfig.password());\n            containerizer = Containerizer.to(registryImage);\n        } else {","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java#L255-L291","documentation":"JibProcessor.containerize() wraps the entire Jib build/push operation in a broad catch block and rethrows any Exception as RuntimeException(\"Unable to create container image\", e). It is a generic failure boundary: the real cause (auth failure, network error, registry rejection, daemon error, bad config) is in the wrapped cause.","triggerScenarios":"Running a container-image build (mvn package -Dquarkus.container-image.build=true or quarkus:build target) where any step inside containerize() throws: Jib's build() fails, registry authentication fails, base image pull fails, layer extraction fails, or push to registry is rejected.","commonSituations":"Unauthenticated registry access (missing ~/.docker/config.json credentials), no network/DNS to registry, invalid base image name in quarkus.container-image.* config, registry rate limits, container-image.registry or username/password misconfiguration, JVM_OPTS/memory issues during layer processing.","solutions":["Read the full stack trace's cause (the wrapped exception) — this message itself is only a wrapper","Run with -Dquarkus.jib.base-jvm-image or verify image names: quarkus.container-image.image, .registry, .group, .name","Verify registry credentials: docker login to the target registry, or set quarkus.container-image.username/password","Check network/proxy access to the registry and that the registry exists","If pushing, confirm quarkus.container-image.push=true and the repository path is correct/created"],"exampleFix":"// before: opaque failure, no idea why\nmvn package -Dquarkus.container-image.build=true\n// after: isolate the cause and configure explicitly\nmvn package -Dquarkus.container-image.build=true -X 2>&1 | grep -A20 'Caused by'","handlingStrategy":"try-catch","validationCode":"// before invoking the image build\njava.io.File dockerCfg = new java.io.File(System.getProperty(\"user.home\"), \".docker/config.json\");\nif (push && !dockerCfg.exists()) throw new IllegalStateException(\"No docker credentials; run docker login first\");\nString image = config.registry() + \"/\" + config.group() + \"/\" + config.name() + \":\" + config.tag();\n// sanity-check image name format\nif (!image.matches(\"[a-z0-9./:_-]+\")) throw new IllegalStateException(\"Invalid image name: \" + image);","typeGuard":null,"tryCatchPattern":"try {\n    buildContainerImage();\n} catch (RuntimeException e) {\n    // 'Unable to create container image' wraps the real cause\n    Throwable cause = e.getCause();\n    log.errorf(e, \"Jib image build failed: %s\", cause == null ? e : cause.getMessage());\n    if (cause != null && cause.getMessage() != null && cause.getMessage().contains(\"Unauthorized\")) {\n        throw new IllegalStateException(\"Registry auth failed; run docker login\", e);\n    }\n    throw e;\n}","preventionTips":["Always read the cause chain, not the wrapper message","docker login to the target registry before building/pushing","Keep quarkus.container-image.registry/username/password in env vars or Maven settings, not hardcoded","Test the image build in CI before it blocks a release","Pin base images (with digest or fixed tags) that your registry can actually pull"],"tags":["container-image","jib","build","docker"],"backgroundTag":"container-image-build-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}