docker/cli ยท error

volume options are incompatible with type npipe

Error message

volume options are incompatible with type npipe

What it means

Raised by handleNpipeToMount when a `type: npipe` volume carries a `volume:` options block. Named-volume options (nocopy, subpath) don't apply to named-pipe mounts; note npipe mounts do accept a `bind:` block for propagation, but not volume options.

Source

Thrown at cli/compose/convert/volume.go:179

	if volume.Cluster != nil {
		return mount.Mount{}, errors.New("cluster options are incompatible with type tmpfs")
	}
	if volume.Tmpfs != nil {
		result.TmpfsOptions = &mount.TmpfsOptions{
			SizeBytes: volume.Tmpfs.Size,
		}
	}
	return result, nil
}

func handleNpipeToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) {
	result := createMountFromVolume(volume)

	if volume.Source == "" {
		return mount.Mount{}, errors.New("invalid npipe source, source cannot be empty")
	}
	if volume.Volume != nil {
		return mount.Mount{}, errors.New("volume options are incompatible with type npipe")
	}
	if volume.Image != nil {
		return mount.Mount{}, errors.New("image options are incompatible with type npipe")
	}
	if volume.Tmpfs != nil {
		return mount.Mount{}, errors.New("tmpfs options are incompatible with type npipe")
	}
	if volume.Bind != nil {
		result.BindOptions = &mount.BindOptions{
			Propagation: mount.Propagation(volume.Bind.Propagation),
		}
	}
	return result, nil
}

func handleClusterToMount(
	volume composetypes.ServiceVolumeConfig,
	stackVolumes volumes,

View on GitHub (pinned to e9452d6e78)

Solutions

  1. Remove the `volume:` block from the npipe entry
  2. If named-volume behavior was intended, use `type: volume` instead of npipe

Example fix

# before
volumes:
  - type: npipe
    source: \\.\pipe\docker_engine
    target: \\.\pipe\docker_engine
    volume:
      nocopy: true
# after
volumes:
  - type: npipe
    source: \\.\pipe\docker_engine
    target: \\.\pipe\docker_engine

When it happens

Trigger: ServiceVolumeConfig with Type npipe and Volume != nil, e.g. `type: npipe` plus `volume: {nocopy: true}`, during `docker stack deploy`.

Common situations: Windows stack files adapted from named-volume entries without removing the `volume:` block; generators emitting volume options unconditionally.

Related errors


AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01). Data as JSON: /data/errors/2d75f7295fab9bed.json. Report an issue: GitHub.