docker/cli · error

is only supported on a Docker daemon with experimental…

Error message

%s is only supported on a Docker daemon with experimental features enabled

What it means

Subcommand-level mirror of error 581. Thrown by areSubcommandsSupported() when the command (or an ancestor) is annotated `experimental` but the daemon's ServerInfo().HasExperimental is false. The entire command requires experimental daemon features.

Solutions

  1. Enable experimental mode on the daemon (daemon.json "experimental": true + restart, or dockerd --experimental).
  2. Upgrade both daemon and CLI — the command may have graduated out of experimental.
  3. Avoid the command if experimental is not acceptable in your environment.

Example fix

# before
sudo dockerd
docker <experimental-cmd>
# after
sudo dockerd --experimental
docker <experimental-cmd>
Defensive patterns

Strategy: validation

Validate before calling

info, err := cli.ServerInfo(ctx)
if err != nil { return err }
if !info.HasExperimental { return errors.New("daemon lacks experimental; command unavailable") }

Prevention

When it happens

Trigger: Running a command annotated experimental against a daemon that was not started with experimental mode enabled.

Common situations: Preview/stage commands on production daemons (experimental disabled); daemon.json without experimental:true; version skew where the command is still experimental in the installed CLI.

Related errors


AI-assisted analysis of docker/cli@4f84911bfe (2026-08-07). Data as JSON: /api/errors/a68a5d26738f7e48. Report an issue: GitHub.

Appendix: source

Thrown at cmd/docker/docker.go:726

func areSubcommandsSupported(cmd *cobra.Command, details versionDetails) error {
	// Check recursively so that, e.g., `docker stack ls` returns the same output as `docker stack`
	for curr := cmd; curr != nil; curr = curr.Parent() {
		// Important: in the code below, calls to "details.CurrentVersion()" and
		// "details.ServerInfo()" are deliberately executed inline to make them
		// be executed "lazily". This is to prevent making a connection with the
		// daemon to perform a "ping" (even for commands that do not require a
		// daemon connection).
		//
		// See commit b39739123b845f872549e91be184cc583f5b387c for details.

		if cmdVersion, ok := curr.Annotations["version"]; ok && versions.LessThan(details.CurrentVersion(), cmdVersion) {
			return fmt.Errorf("%s requires API version %s, but the Docker daemon API version is %s", cmd.CommandPath(), cmdVersion, details.CurrentVersion())
		}
		if ost, ok := curr.Annotations["ostype"]; ok && details.ServerInfo().OSType != "" && ost != details.ServerInfo().OSType {
			return fmt.Errorf("%s is only supported on a Docker daemon running on %s, but the Docker daemon is running on %s", cmd.CommandPath(), ost, details.ServerInfo().OSType)
		}
		if _, ok := curr.Annotations["experimental"]; ok && !details.ServerInfo().HasExperimental {
			return fmt.Errorf("%s is only supported on a Docker daemon with experimental features enabled", cmd.CommandPath())
		}
	}
	return nil
}

func getFlagAnnotation(f *pflag.Flag, annotation string) string {
	if value, ok := f.Annotations[annotation]; ok && len(value) == 1 {
		return value[0]
	}
	return ""
}

func isVersionSupported(f *pflag.Flag, clientVersion string) bool {
	if v := getFlagAnnotation(f, "version"); v != "" {
		return versions.GreaterThanOrEqualTo(clientVersion, v)
	}
	return true
}

View on GitHub (pinned to 4f84911bfe)