MCPcopy
hub / github.com/docker/compose / runPublish

Function runPublish

cmd/compose/publish.go:76–102  ·  view source on GitHub ↗
(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts publishOptions, repository string)

Source from the content-addressed store, hash-verified

74}
75
76func runPublish(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts publishOptions, repository string) error {
77 if opts.assumeYes {
78 backendOptions.Options = append(backendOptions.Options, compose.WithPrompt(compose.AlwaysOkPrompt()))
79 }
80
81 backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...)
82 if err != nil {
83 return err
84 }
85
86 project, metrics, err := opts.ToProject(ctx, dockerCli, backend, nil)
87 if err != nil {
88 return err
89 }
90
91 if metrics.CountIncludesLocal > 0 {
92 return errors.New("cannot publish compose file with local includes")
93 }
94
95 return backend.Publish(ctx, project, repository, api.PublishOptions{
96 ResolveImageDigests: opts.resolveImageDigests || opts.app,
97 Application: opts.app,
98 OCIVersion: api.OCIVersion(opts.ociVersion),
99 WithEnvironment: opts.withEnvironment,
100 InsecureRegistry: opts.insecureRegistry,
101 })
102}

Callers 1

publishCommandFunction · 0.85

Calls 6

WithPromptFunction · 0.92
AlwaysOkPromptFunction · 0.92
NewComposeServiceFunction · 0.92
OCIVersionTypeAlias · 0.92
PublishMethod · 0.65
ToProjectMethod · 0.45

Tested by

no test coverage detected