docker/cli ยท error

cluster options are incompatible with type bind

Error message

cluster options are incompatible with type bind

What it means

Raised by handleBindToMount when a `type: bind` service volume also carries a `cluster:` options block. Cluster options apply only to Swarm cluster (CSI) volumes, so the converter fails fast instead of ignoring a block that can never take effect on a bind mount.

Source

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

}

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

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

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

	if volume.Source != "" {
		return mount.Mount{}, errors.New("invalid tmpfs source, source must be empty")
	}
	if volume.Bind != nil {
		return mount.Mount{}, errors.New("bind options are incompatible with type tmpfs")
	}

View on GitHub (pinned to e9452d6e78)

Solutions

  1. Delete the `cluster:` block from the bind volume entry
  2. If a CSI/cluster volume was intended, set `type: cluster` and remove bind-specific fields

Example fix

# before
volumes:
  - type: bind
    source: /host/data
    target: /data
    cluster: {}
# after
volumes:
  - type: bind
    source: /host/data
    target: /data

When it happens

Trigger: Compose long-syntax volume with `type: bind` where the parsed ServiceVolumeConfig has Cluster != nil, converted during `docker stack deploy`.

Common situations: Adapting a cluster-volume entry to a bind mount without removing the cluster block; mixing CSI volume config into the wrong service volume via YAML anchors or merge keys.

Related errors


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