docker/cli ยท error

invalid value for %s: %s (must be "enabled", "disabled", "wr

Error message

invalid value for %s: %s (must be "enabled", "disabled", "writable", or "readonly")

What it means

Error "invalid value for %s: %s (must be "enabled", "disabled", "writable", or "readonly")" thrown in docker/cli.

Source

Thrown at opts/mount.go:103

			mount.Consistency = mounttypes.Consistency(strings.ToLower(val))
		case "bind-propagation":
			ensureBindOptions(&mount).Propagation = mounttypes.Propagation(strings.ToLower(val))
		case "bind-nonrecursive":
			return errors.New("bind-nonrecursive is deprecated, use bind-recursive=disabled instead")
		case "bind-recursive":
			switch val {
			case "enabled": // read-only mounts are recursively read-only if Engine >= v25 && kernel >= v5.12, otherwise writable
				// NOP
			case "disabled": // previously "bind-nonrecursive=true"
				ensureBindOptions(&mount).NonRecursive = true
			case "writable": // conforms to the default read-only bind-mount of Docker v24; read-only mounts are recursively mounted but not recursively read-only
				ensureBindOptions(&mount).ReadOnlyNonRecursive = true
			case "readonly": // force recursively read-only, or raise an error
				ensureBindOptions(&mount).ReadOnlyForceRecursive = true
				// TODO: implicitly set propagation and error if the user specifies a propagation in a future refactor/UX polish pass
				// https://github.com/docker/cli/pull/4316#discussion_r1341974730
			default:
				return fmt.Errorf(`invalid value for %s: %s (must be "enabled", "disabled", "writable", or "readonly")`, key, val)
			}
		case "bind-create-src":
			ensureBindOptions(&mount).CreateMountpoint, err = parseBoolValue(key, val, hasValue)
			if err != nil {
				return err
			}
		case "volume-subpath":
			ensureVolumeOptions(&mount).Subpath = val
		case "volume-nocopy":
			ensureVolumeOptions(&mount).NoCopy, err = parseBoolValue(key, val, hasValue)
			if err != nil {
				return err
			}
		case "volume-label":
			volumeOpts := ensureVolumeOptions(&mount)
			volumeOpts.Labels = setValueOnMap(volumeOpts.Labels, val)
		case "volume-driver":
			ensureVolumeDriver(&mount).Name = val

View on GitHub (pinned to e9452d6e78)

When it happens

Trigger: Thrown at opts/mount.go:103 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/0bb9c5ab7c2229f7.json. Report an issue: GitHub.