MCPcopy Index your code
hub / github.com/docker/cli / runDeploy

Function runDeploy

cli/command/stack/deploy.go:81–95  ·  view source on GitHub ↗

runDeploy is the swarm implementation of docker stack deploy

(ctx context.Context, dockerCLI command.Cli, flags *pflag.FlagSet, opts *deployOptions, cfg *composetypes.Config)

Source from the content-addressed store, hash-verified

79
80// runDeploy is the swarm implementation of docker stack deploy
81func runDeploy(ctx context.Context, dockerCLI command.Cli, flags *pflag.FlagSet, opts *deployOptions, cfg *composetypes.Config) error {
82 switch opts.resolveImage {
83 case resolveImageAlways, resolveImageChanged, resolveImageNever:
84 // valid options.
85 default:
86 return fmt.Errorf("invalid option %s for flag --resolve-image", opts.resolveImage)
87 }
88
89 if opts.detach && !flags.Changed("detach") {
90 _, _ = fmt.Fprintln(dockerCLI.Err(), "Since --detach=false was not specified, tasks will be created in the background.\n"+
91 "In a future release, --detach=false will become the default.")
92 }
93
94 return deployCompose(ctx, dockerCLI, opts, cfg)
95}
96
97// checkDaemonIsSwarmManager does an Info API call to verify that the daemon is
98// a swarm manager. This is necessary because we must create networks before we

Callers 1

newDeployCommandFunction · 0.85

Calls 2

deployComposeFunction · 0.85
ErrMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…