docker/cli ยท error

cannot mix 'cluster-*' options with mount type '%s'

Error message

cannot mix 'cluster-*' options with mount type '%s'

What it means

Error "cannot mix 'cluster-*' options with mount type '%s'" thrown in docker/cli.

Source

Thrown at opts/mount_utils.go:65

func validateExclusiveOptions(m *mount.Mount) error {
	if m.Type == "" {
		return errors.New("type is required")
	}

	if m.Type != mount.TypeBind && m.BindOptions != nil {
		return fmt.Errorf("cannot mix 'bind-*' options with mount type '%s'", m.Type)
	}
	if m.Type != mount.TypeVolume && m.VolumeOptions != nil {
		return fmt.Errorf("cannot mix 'volume-*' options with mount type '%s'", m.Type)
	}
	if m.Type != mount.TypeImage && m.ImageOptions != nil {
		return fmt.Errorf("cannot mix 'image-*' options with mount type '%s'", m.Type)
	}
	if m.Type != mount.TypeTmpfs && m.TmpfsOptions != nil {
		return fmt.Errorf("cannot mix 'tmpfs-*' options with mount type '%s'", m.Type)
	}
	if m.Type != mount.TypeCluster && m.ClusterOptions != nil {
		return fmt.Errorf("cannot mix 'cluster-*' options with mount type '%s'", m.Type)
	}
	return nil
}

// parseBoolValue returns the boolean value represented by the string. It returns
// true if no value is set.
//
// It is similar to [strconv.ParseBool], but only accepts 1, true, 0, false.
// Any other value returns an error.
func parseBoolValue(key string, val string, hasValue bool) (bool, error) {
	if !hasValue {
		return true, nil
	}
	switch val {
	case "1", "true":
		return true, nil
	case "0", "false":
		return false, nil

View on GitHub (pinned to e9452d6e78)

When it happens

Trigger: Thrown at opts/mount_utils.go:65 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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