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

Function pushCommand

cmd/compose/push.go:38–55  ·  cmd/compose/push.go::pushCommand
(p *ProjectOptions, dockerCli command.Cli, backendOptions *BackendOptions)

Source from the content-addressed store, hash-verified

36}
37
38func pushCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *BackendOptions) *cobra.Command {
39 opts := pushOptions{
40 ProjectOptions: p,
41 }
42 pushCmd := &cobra.Command{
43 Use: "push [OPTIONS] [SERVICE...]",
44 Short: "Push service images",
45 RunE: Adapt(func(ctx context.Context, args []string) error {
46 return runPush(ctx, dockerCli, backendOptions, opts, args)
47 }),
48 ValidArgsFunction: completeServiceNames(dockerCli, p),
49 }
50 pushCmd.Flags().BoolVar(&opts.Ignorefailures, "ignore-push-failures", false, "Push what it can and ignores images with push failures")
51 pushCmd.Flags().BoolVar(&opts.IncludeDeps, "include-deps", false, "Also push images of services declared as dependencies")
52 pushCmd.Flags().BoolVarP(&opts.Quiet, "quiet", "q", false, "Push without printing progress information")
53
54 return pushCmd
55}
56
57func runPush(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts pushOptions, services []string) error {
58 backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...)

Callers 1

RootCommandFunction · 0.85

Calls 3

AdaptFunction · 0.85
runPushFunction · 0.85
completeServiceNamesFunction · 0.85

Tested by

no test coverage detected