{"id":"093efde16d2b9771","repo":"docker/cli","slug":"invalid-option-s-for-flag-resolve-image","errorCode":null,"errorMessage":"invalid option %s for flag --resolve-image","messagePattern":"invalid option (.+?) for flag --resolve-image","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/stack/deploy.go","lineNumber":86,"sourceCode":"\treturn cmd\n}\n\n// Resolve image constants\nconst (\n\tresolveImageAlways  = \"always\"\n\tresolveImageChanged = \"changed\"\n\tresolveImageNever   = \"never\"\n)\n\nconst defaultNetworkDriver = \"overlay\"\n\n// runDeploy is the swarm implementation of docker stack deploy\nfunc runDeploy(ctx context.Context, dockerCLI command.Cli, flags *pflag.FlagSet, opts *deployOptions, cfg *composetypes.Config) error {\n\tswitch opts.resolveImage {\n\tcase resolveImageAlways, resolveImageChanged, resolveImageNever:\n\t\t// valid options.\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid option %s for flag --resolve-image\", opts.resolveImage)\n\t}\n\n\tif opts.detach && !flags.Changed(\"detach\") {\n\t\t_, _ = fmt.Fprintln(dockerCLI.Err(), \"Since --detach=false was not specified, tasks will be created in the background.\\n\"+\n\t\t\t\"In a future release, --detach=false will become the default.\")\n\t}\n\n\treturn deployCompose(ctx, dockerCLI, opts, cfg)\n}\n\n// checkDaemonIsSwarmManager does an Info API call to verify that the daemon is\n// a swarm manager. This is necessary because we must create networks before we\n// create services, but the API call for creating a network does not return a\n// proper status code when it can't create a network in the \"global\" scope.\nfunc checkDaemonIsSwarmManager(ctx context.Context, dockerCli command.Cli) error {\n\tres, err := dockerCli.Client().Info(ctx, client.InfoOptions{})\n\tif err != nil {\n\t\treturn err","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/stack/deploy.go#L68-L104","documentation":"Error \"invalid option %s for flag --resolve-image\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/stack/deploy.go:86 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}