docker/cli ยท error

value is empty

Error message

value is empty

What it means

Error "value is empty" thrown in docker/cli.

Source

Thrown at opts/mount.go:27

	"strconv"
	"strings"

	"github.com/docker/go-units"
	mounttypes "github.com/moby/moby/api/types/mount"
)

// MountOpt is a Value type for parsing mounts
type MountOpt struct {
	values []mounttypes.Mount
}

// Set a new mount value
//
//nolint:gocyclo
func (m *MountOpt) Set(value string) error {
	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 {

View on GitHub (pinned to e9452d6e78)

When it happens

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