{"record":{"id":"082c76088a6b976b","repo":"GoogleContainerTools/skaffold","slug":"loading-image-into-docker-daemon-w","errorCode":null,"errorMessage":"loading image into docker daemon: %w","messagePattern":"loading image into docker daemon: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/image.go","lineNumber":561,"sourceCode":"\t\t\t//   2. If `encodedRegistryAuth()` succeeded (so `err == nil`), then our credential was rejected, so\n\t\t\t//     return \"\" to retry as an anonymous pull.\n\t\t\treturn \"\", err\n\t\t},\n\t\tPlatforms: platforms,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"pulling image from repository: %w\", err)\n\t}\n\tdefer rc.Close()\n\n\treturn streamDockerMessages(out, rc, nil)\n}\n\n// Load loads an image from a tar file. Returns the imageID for the loaded image.\nfunc (l *localDaemon) Load(ctx context.Context, out io.Writer, input io.Reader, ref string) (string, error) {\n\tresp, err := l.apiClient.ImageLoad(ctx, input)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"loading image into docker daemon: %w\", err)\n\t}\n\tdefer resp.Close()\n\n\tif err := streamDockerMessages(out, resp, nil); err != nil {\n\t\treturn \"\", fmt.Errorf(\"reading from image load response: %w\", err)\n\t}\n\n\treturn l.ImageID(ctx, ref)\n}\n\n// Tag adds a tag to an image.\nfunc (l *localDaemon) Tag(ctx context.Context, image, ref string) error {\n\t_, err := l.apiClient.ImageTag(ctx, client.ImageTagOptions{Source: image, Target: ref})\n\treturn err\n}\n\n// For k8s, we need a unique, immutable ID for the image.\n// k8s doesn't recognize the imageID or any combination of the image name","sourceCodeStart":543,"sourceCodeEnd":579,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/image.go#L543-L579","documentation":"localDaemon.Load wraps errors from apiClient.ImageLoad when streaming a tarball into the Docker daemon (`docker load`). This fires when the daemon rejects the load request itself — before any output streaming. The underlying client/daemon error is preserved via %w.","triggerScenarios":"Calling Load(ctx, out, input, ref) when ImageLoad fails: Docker daemon not running/unreachable, the input reader yields an invalid or truncated tar archive, or permission denied on the Docker socket.","commonSituations":"Docker Desktop stopped while running skaffold, a corrupted or empty image tar passed as input, user not in the `docker` group (permission denied on /var/run/docker.sock), loading a tar produced by a different container tool (e.g. podman save with incompatible format).","solutions":["Confirm the daemon is reachable: `docker info` (start Docker Desktop / the docker service if not).","Check socket permissions: add yourself to the `docker` group or fix DOCKER_HOST.","Validate the input tar: `docker load -i <file>` manually; regenerate it if truncated (e.g. incomplete kaniko/jib build output).","If the tar came from another tool, re-export in docker-compatible format (`docker save` or `podman save --format docker-archive`)."],"exampleFix":"// before: daemon down\n$ skaffold dev\n// after\n$ sudo systemctl start docker  # or start Docker Desktop\n$ skaffold dev","handlingStrategy":"validation","validationCode":"// daemon reachable and input is a non-empty reader before calling Load\nif err := client.Info(ctx); err != nil { return fmt.Errorf(\"docker daemon unreachable: %w\", err) }\nfi, err := tarFile.Stat()\nif err != nil || fi.Size() == 0 { return errors.New(\"image tar missing or empty\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check `docker info` as a pre-flight in scripts that call Load.","Validate tar archives (size > 0, `tar -tf` succeeds) before loading.","Ensure the user is in the `docker` group or DOCKER_HOST is set correctly.","Export archives in docker-compatible format when mixing container tools."],"tags":["docker","load","daemon","tar"],"backgroundTag":"docker-daemon-unreachable","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"}