docker/cli ยท error

bind options are incompatible with type tmpfs

Error message

bind options are incompatible with type tmpfs

What it means

Raised by handleTmpfsToMount when a `type: tmpfs` volume also carries a `bind:` options block (e.g. propagation). Bind propagation settings only apply to bind mounts, so the converter rejects the mismatched block rather than ignoring it.

Source

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

	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")
	}
	if volume.Volume != nil {
		return mount.Mount{}, errors.New("volume options are incompatible with type tmpfs")
	}
	if volume.Image != nil {
		return mount.Mount{}, errors.New("image options are incompatible with type tmpfs")
	}
	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
}

View on GitHub (pinned to e9452d6e78)

Solutions

  1. Remove the `bind:` block from the tmpfs volume entry
  2. If propagation is genuinely needed, keep the mount as `type: bind` with a valid `source:`

Example fix

# before
volumes:
  - type: tmpfs
    target: /cache
    bind:
      propagation: shared
# after
volumes:
  - type: tmpfs
    target: /cache

When it happens

Trigger: ServiceVolumeConfig with Type tmpfs and Bind != nil, e.g. compose YAML with `type: tmpfs` plus `bind: {propagation: shared}`, during `docker stack deploy` conversion.

Common situations: Retyping a bind mount to tmpfs without removing its `bind:` block; YAML anchor reuse copying bind options across entries.

Related errors


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