GoogleContainerTools/skaffold · error

could not connect to local docker daemon: %w

Error message

could not connect to local docker daemon: %w

What it means

Fires in RetrieveImageConfiguration when a Docker API client cannot be created to inspect the artifact's image. The local docker daemon is unreachable (daemon not running, wrong DOCKER_HOST/socket permissions) — needed because image config may be resolved from the local daemon before falling back to a remote registry.

Source

Thrown at pkg/skaffold/debug/apply_transforms.go:62

	}
	for _, artifact := range builds {
		if image == artifact.ImageName || image == artifact.Tag {
			log.Entry(context.TODO()).Debugf("Found artifact for image %q", image)
			return &artifact
		}
	}
	return nil
}

// RetrieveImageConfiguration retrieves the image container configuration for
// the given build artifact
func RetrieveImageConfiguration(ctx context.Context, artifact *graph.Artifact, insecureRegistries map[string]bool) (ImageConfiguration, error) {
	// TODO: use the proper RunContext
	apiClient, err := docker.NewAPIClient(ctx, &runcontext.RunContext{
		InsecureRegistries: insecureRegistries,
	})
	if err != nil {
		return ImageConfiguration{}, fmt.Errorf("could not connect to local docker daemon: %w", err)
	}

	// the apiClient will go to the remote registry if local docker daemon is not available
	manifest, err := apiClient.ConfigFile(ctx, artifact.Tag)
	if err != nil {
		log.Entry(ctx).Debugf("Error retrieving image manifest for %v: %v", artifact.Tag, err)
		return ImageConfiguration{}, fmt.Errorf("retrieving image config for %q: %w", artifact.Tag, err)
	}

	config := manifest.Config
	log.Entry(ctx).Debugf("Retrieved local image configuration for %v: %v", artifact.Tag, config)
	// need to duplicate slices as apiClient caches requests
	return ImageConfiguration{
		Artifact:    artifact.ImageName,
		RuntimeType: types.ToRuntime(artifact.RuntimeType),
		Author:      manifest.Author,
		Env:         envAsMap(config.Env),
		Entrypoint:  dupArray(config.Entrypoint),

View on GitHub (pinned to a1189de023)

Solutions

  1. Start the Docker daemon (e.g. `systemctl start docker` or open Docker Desktop)
  2. Verify DOCKER_HOST points to a reachable daemon and the socket is accessible (`docker ps`)
  3. Fix socket permissions or group membership if access is denied
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/skaffold/debug/apply_transforms.go:62 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/34bef7f8ab899ee6. Report an issue: GitHub.