docker/cli · error · errdefs.ErrInvalidParameter
error parsing specified platform: %w
Error message
error parsing specified platform: %w
What it means
Error "error parsing specified platform: %w" thrown in docker/cli.
Source
Thrown at cli/command/container/create.go:316
// Resolve this here for later, ensuring we error our before we create the container.
creds, err := readCredentials(dockerCLI)
if err != nil {
return "", fmt.Errorf("resolving credentials failed: %w", err)
}
if len(creds) > 0 {
// Set our special little location for the config file.
containerCfg.Config.Env = append(containerCfg.Config.Env, "DOCKER_CONFIG="+path.Dir(dockerConfigPathInContainer))
apiSocketCreds = creds // inject these after container creation.
}
}
}
var platform *ocispec.Platform
if options.platform != "" {
p, err := platforms.Parse(options.platform)
if err != nil {
return "", invalidParameter(fmt.Errorf("error parsing specified platform: %w", err))
}
platform = &p
}
if options.pull == PullImageAlways {
if err := pullImage(ctx, dockerCLI, config.Image, options); err != nil {
return "", err
}
}
hostConfig.ConsoleSize[0], hostConfig.ConsoleSize[1] = dockerCLI.Out().GetTtySize()
response, err := dockerCLI.Client().ContainerCreate(ctx, client.ContainerCreateOptions{
Name: options.name,
// Image: config.Image, // TODO(thaJeztah): pass image-ref separate
Platform: platform,
Config: config,
HostConfig: hostConfig,View on GitHub (pinned to e9452d6e78)
When it happens
Trigger: Thrown at cli/command/container/create.go:316 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/a69df8ef0b53d032.json.
Report an issue: GitHub.