docker/cli ยท error
invalid option '%s' in '%s': option should not have whitespa
Error message
invalid option '%s' in '%s': option should not have whitespace
What it means
Error "invalid option '%s' in '%s': option should not have whitespace" thrown in docker/cli.
Source
Thrown at opts/mount.go:43
value = strings.TrimSpace(value)
if value == "" {
return errors.New("value is empty")
}
csvReader := csv.NewReader(strings.NewReader(value))
fields, err := csvReader.Read()
if err != nil {
return err
}
mount := mounttypes.Mount{
Type: mounttypes.TypeVolume, // default to volume mounts
}
for _, field := range fields {
key, val, hasValue := strings.Cut(field, "=")
if k := strings.TrimSpace(key); k != key {
return fmt.Errorf("invalid option '%s' in '%s': option should not have whitespace", k, field)
}
if hasValue {
v := strings.TrimSpace(val)
if v == "" {
return fmt.Errorf("invalid value for '%s': value is empty", key)
}
if v != val {
return fmt.Errorf("invalid value for '%s' in '%s': value should not have whitespace", key, field)
}
}
// TODO(thaJeztah): these options should not be case-insensitive.
key = strings.ToLower(key)
if !hasValue {
switch key {
case "readonly", "ro", "volume-nocopy", "bind-nonrecursive", "bind-create-src":
// boolean valuesView on GitHub (pinned to e9452d6e78)
When it happens
Trigger: Thrown at opts/mount.go:43 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/6cb8257839119508.json.
Report an issue: GitHub.