{"id":"a69df8ef0b53d032","repo":"docker/cli","slug":"error-parsing-specified-platform-w","errorCode":null,"errorMessage":"error parsing specified platform: %w","messagePattern":"error parsing specified platform: %w","errorType":"validation","errorClass":"errdefs.ErrInvalidParameter","httpStatus":null,"severity":"error","filePath":"cli/command/container/create.go","lineNumber":316,"sourceCode":"\t\t\t// Resolve this here for later, ensuring we error our before we create the container.\n\t\t\tcreds, err := readCredentials(dockerCLI)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", fmt.Errorf(\"resolving credentials failed: %w\", err)\n\t\t\t}\n\t\t\tif len(creds) > 0 {\n\t\t\t\t// Set our special little location for the config file.\n\t\t\t\tcontainerCfg.Config.Env = append(containerCfg.Config.Env, \"DOCKER_CONFIG=\"+path.Dir(dockerConfigPathInContainer))\n\n\t\t\t\tapiSocketCreds = creds // inject these after container creation.\n\t\t\t}\n\t\t}\n\t}\n\n\tvar platform *ocispec.Platform\n\tif options.platform != \"\" {\n\t\tp, err := platforms.Parse(options.platform)\n\t\tif err != nil {\n\t\t\treturn \"\", invalidParameter(fmt.Errorf(\"error parsing specified platform: %w\", err))\n\t\t}\n\t\tplatform = &p\n\t}\n\n\tif options.pull == PullImageAlways {\n\t\tif err := pullImage(ctx, dockerCLI, config.Image, options); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\thostConfig.ConsoleSize[0], hostConfig.ConsoleSize[1] = dockerCLI.Out().GetTtySize()\n\n\tresponse, err := dockerCLI.Client().ContainerCreate(ctx, client.ContainerCreateOptions{\n\t\tName: options.name,\n\t\t// Image:            config.Image, // TODO(thaJeztah): pass image-ref separate\n\t\tPlatform:         platform,\n\t\tConfig:           config,\n\t\tHostConfig:       hostConfig,","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/container/create.go#L298-L334","documentation":"Error \"error parsing specified platform: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/container/create.go:316 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}