GoogleContainerTools/skaffold · error

creating container in local docker

Error message

creating container in local docker

What it means

The docker verify runner failed to create/start the verification container via the local Docker daemon (client.Run). The error wraps the underlying docker API error, reported while running a verify test case locally.

Source

Thrown at pkg/skaffold/verify/docker/verify.go:260

	opts.Bindings = bindings
	// verify waits for run to complete
	opts.Wait = true
	// adding in env vars from verify container schema field
	envVars := []string{}
	for _, env := range tc.Container.Env {
		envVars = append(envVars, env.Name+"="+env.Value)
	}
	// adding in env vars parsed from --verify-env-file flag
	for k, v := range v.envMap {
		envVars = append(envVars, k+"="+v)
	}
	opts.ContainerConfig.Env = envVars

	eventV2.VerifyInProgress(opts.VerifyTestName)
	statusCh, errCh, id, err := v.client.Run(ctx, out, opts)
	if err != nil {
		eventV2.VerifyFailed(tc.Name, err)
		return errors.Wrap(err, "creating container in local docker")
	}
	v.TrackContainerFromBuild(graph.Artifact{
		ImageName: opts.VerifyTestName,
		Tag:       opts.VerifyTestName,
	}, tracker.Container{Name: containerName, ID: id})

	var timeoutDuration *time.Duration = nil
	if tc.Config.Timeout != nil {
		timeoutDuration = util.Ptr(time.Second * time.Duration(*tc.Config.Timeout))
	}

	var containerErr error
	select {
	case err := <-errCh:
		if err != nil {
			containerErr = err
		}
	case status := <-statusCh:

View on GitHub (pinned to a1189de023)

Solutions

  1. Check the wrapped docker error for the root cause (image not found, daemon unreachable, etc.)
  2. Confirm Docker is running (`docker ps`) and the verify image exists locally (`docker images`)
  3. Ensure the verify test's image is built and its tag matches opts.VerifyTestName
  4. Check container config: env vars, ports, network name passed in opts

Example fix

// before: verify against an image never built
verify:
  - name: test
    container:
      image: missing-image
// after: add it to build.artifacts first
build:
  artifacts:
    - image: missing-image
Defensive patterns

Strategy: validation

Validate before calling

// Before verify: docker daemon up and image present
if _, err := exec.LookPath("docker"); err != nil { return errors.New("docker not installed") }
if err := exec.Command("docker", "image", "inspect", verifyImage).Run(); err != nil {
    return fmt.Errorf("verify image %s not built locally", verifyImage)
}

Try / catch

if err := verifier.Verify(ctx, out, tc); err != nil {
    if strings.Contains(err.Error(), "creating container in local docker") {
        return fmt.Errorf("docker verify could not start container: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: createAndRunContainer calls v.client.Run(ctx, out, opts) and the docker daemon rejects container creation — bad image, missing image locally, invalid env/port/network opts, daemon down.

Common situations: Verify image not built or not tagged correctly; Docker Desktop not running; unsupported verify container options; network referenced by verify not present; insufficient disk space.

Related errors


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