{"record":{"id":"3f326d5bac5f956a","repo":"GoogleContainerTools/skaffold","slug":"normalizing-dockerfile-path-w","errorCode":null,"errorMessage":"normalizing dockerfile path: %w","messagePattern":"normalizing dockerfile path: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/build_args.go","lineNumber":70,"sourceCode":"\tswitch mode {\n\tcase config.RunModes.Debug:\n\t\tdefaults = debugModeArgs\n\tdefault:\n\t\tdefaults = nonDebugModeArgs\n\t}\n\tresult := map[string]*string{\n\t\t\"SKAFFOLD_RUN_MODE\": util.Ptr(string(mode)),\n\t}\n\tfor k, v := range defaults {\n\t\tresult[k] = &v\n\t}\n\n\tfor k, v := range extra {\n\t\tresult[k] = v\n\t}\n\tabsDockerfilePath, err := NormalizeDockerfilePath(workspace, dockerfilePath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"normalizing dockerfile path: %w\", err)\n\t}\n\tf, err := os.Open(absDockerfilePath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"reading dockerfile: %w\", err)\n\t}\n\tdefer f.Close()\n\tresult, err = filterUnusedBuildArgs(f, result)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"removing unused default args: %w\", err)\n\t}\n\tfor k, v := range args {\n\t\tresult[k] = v\n\t}\n\tresult, err = util.EvaluateEnvTemplateMapWithEnv(result, env)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to expand build args: %w\", err)\n\t}\n\treturn result, nil","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/build_args.go#L52-L88","documentation":"Wraps a failure from NormalizeDockerfilePath when resolving the absolute Dockerfile path within the artifact workspace. evalBuildArgs must read the Dockerfile to filter unused build args, so a bad path aborts build-arg evaluation.","triggerScenarios":"evalBuildArgs runs with a dockerfilePath that, after joining with workspace, doesn't exist, escapes the workspace, or is a directory instead of a file.","commonSituations":"dockerfile path typo in skaffold.yaml; Dockerfile in a different context directory than configured; absolute dockerfilePath not under workspace; missing repository checkout (file absent).","solutions":["Verify the dockerfile path exists relative to the artifact context/workspace","Correct skaffold.yaml so docker.dockerfile matches the actual file location","Ensure the workspace was cloned/checked out before build","If using an absolute path, ensure it resolves and is a regular file"],"exampleFix":"// before\ndocker:\n  dockerfile: dockerfiles/Dockerfile.prod  # missing\n// after\ndocker:\n  dockerfile: Dockerfile  # exists in context dir","handlingStrategy":"validation","validationCode":"func dockerfileInWorkspace(ws, df string) error {\n  abs, err := filepath.Abs(filepath.Join(ws, df))\n  if err != nil { return err }\n  if !strings.HasPrefix(abs, filepath.Clean(ws)+string(os.PathSeparator)) {\n    return fmt.Errorf(\"dockerfile %s outside workspace %s\", df, ws)\n  }\n  fi, err := os.Stat(abs)\n  if err != nil { return err }\n  if fi.IsDir() { return fmt.Errorf(\"%s is a directory\", abs) }\n  return nil\n}","typeGuard":null,"tryCatchPattern":"args, err := evalBuildArgs(workspace, df, args, env)\nif err != nil && strings.Contains(err.Error(), \"normalizing dockerfile path\") {\n  return fmt.Errorf(\"check skaffold.yaml docker.dockerfile path: %w\", err)\n}","preventionTips":["Keep docker.dockerfile relative to the artifact context","Ensure the repo/workspace is fully checked out before build","Add a pre-build check that the Dockerfile exists","Avoid absolute dockerfile paths"],"tags":["docker","dockerfile","path","skaffold"],"backgroundTag":"dockerfile-not-found","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}