{"record":{"id":"97abd42694b6aab3","repo":"quarkusio/quarkus","slug":"specified-dockerfile-s-does-not-exist","errorCode":null,"errorMessage":"Specified Dockerfile: '%s' does not exist.","messagePattern":"Specified Dockerfile: '(.+?)' does not exist\\.","errorType":"console","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/ApplyDockerfileToBuildConfigDecorator.java","lineNumber":31,"sourceCode":"import io.dekorate.kubernetes.decorator.NamedResourceDecorator;\nimport io.fabric8.kubernetes.api.model.ObjectMeta;\nimport io.fabric8.openshift.api.model.BuildConfigSpecFluent;\nimport io.quarkus.deployment.util.FileUtil;\n\npublic class ApplyDockerfileToBuildConfigDecorator extends NamedResourceDecorator<BuildConfigSpecFluent<?>> {\n\n    private final Path pathToDockerfile;\n\n    public ApplyDockerfileToBuildConfigDecorator(String name, Path pathToDockerfile) {\n        super(name);\n        validate(pathToDockerfile);\n        this.pathToDockerfile = pathToDockerfile;\n    }\n\n    private void validate(Path pathToDockerfile) {\n        File file = pathToDockerfile.toFile();\n        if (!file.exists()) {\n            throw new IllegalArgumentException(\n                    \"Specified Dockerfile: '\" + pathToDockerfile.toAbsolutePath().toString() + \"' does not exist.\");\n        }\n        if (!file.isFile()) {\n            throw new IllegalArgumentException(\n                    \"Specified Dockerfile: '\" + pathToDockerfile.toAbsolutePath().toString() + \"' is not a normal file.\");\n        }\n\n        try {\n            Stream<String> lines = Files.lines(pathToDockerfile);\n            Optional<String> fromLine = lines.filter(l -> !l.startsWith(\"#\")).map(String::trim)\n                    .filter(l -> l.startsWith(\"FROM\")).findFirst();\n            if (!fromLine.isPresent()) {\n                throw new IllegalArgumentException(\"Specified Dockerfile: '\" + pathToDockerfile.toAbsolutePath().toString()\n                        + \"' does not contain a FROM directive\");\n            }\n        } catch (IOException e) {\n            throw new IllegalArgumentException(\n                    \"Unable to validate specified Dockerfile: '\" + pathToDockerfile.toAbsolutePath().toString() + \"'\");","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/ApplyDockerfileToBuildConfigDecorator.java#L13-L49","documentation":"ApplyDockerfileToBuildConfigDecorator.validate() checks that the Dockerfile path supplied for an OpenShift docker build actually exists before using it. If java.io.File.exists() is false it throws IllegalArgumentException. OpenShift's docker build strategy (quarkus.openshift.build-strategy=docker) relies on this decorator to inline the Dockerfile into the BuildConfig.","triggerScenarios":"quarkus.openshift.dockerfile (or programmatic ApplyDockerfileToBuildConfigDecorator construction) points at a path that does not exist on disk at build/deployment time.","commonSituations":"Typo in quarkus.openshift.dockerfile value, path relative to the wrong working directory (must resolve from the module/project dir), Dockerfile not committed to the repo so CI lacks it, running the deploy goal from a different module directory.","solutions":["Correct the quarkus.openshift.dockerfile path (default is src/main/docker/Dockerfile) — verify the file exists at the printed absolute path","Use a path relative to the module root or an absolute path in application.properties","Commit the Dockerfile to version control so CI/CD environments have it","If the file is generated, ensure the generator runs before the openshift build/deploy goal"],"exampleFix":"// before: application.properties (file actually at src/main/docker/Dockerfile.jvm)\nquarkus.openshift.dockerfile=Dockerfile\n// after: correct path\nquarkus.openshift.dockerfile=src/main/docker/Dockerfile.jvm","handlingStrategy":"validation","validationCode":"// before deploying to OpenShift with a custom Dockerfile\njava.nio.file.Path df = java.nio.file.Path.of(\n    System.getProperty(\"quarkus.openshift.dockerfile\", \"src/main/docker/Dockerfile\"));\nif (!java.nio.file.Files.isRegularFile(df)) {\n    throw new IllegalStateException(\"Dockerfile missing: \" + df.toAbsolutePath());\n}","typeGuard":null,"tryCatchPattern":"try {\n    openshiftDeploy();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"does not exist\")) {\n        throw new IllegalStateException(\"Fix quarkus.openshift.dockerfile path in application.properties\", e);\n    }\n    throw e;\n}","preventionTips":["Verify the Dockerfile exists at the module-relative path before mvn deploy","Commit the Dockerfile to version control","Default convention: src/main/docker/Dockerfile.<flavor>","When using quarkus:deploy, remember the working directory is the module root"],"tags":["openshift","dockerfile","configuration","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}