MCPcopy Create free account
hub / github.com/docker/cli / runPush

Function runPush

cli/command/manifest/push.go:65–91  ·  view source on GitHub ↗
(ctx context.Context, dockerCli command.Cli, opts pushOpts)

Source from the content-addressed store, hash-verified

63}
64
65func runPush(ctx context.Context, dockerCli command.Cli, opts pushOpts) error {
66 targetRef, err := normalizeReference(opts.target)
67 if err != nil {
68 return err
69 }
70
71 manifests, err := newManifestStore(dockerCli).GetList(targetRef)
72 if err != nil {
73 return err
74 }
75 if len(manifests) == 0 {
76 return fmt.Errorf("%s not found", targetRef)
77 }
78
79 req, err := buildPushRequest(manifests, targetRef, opts.insecure)
80 if err != nil {
81 return err
82 }
83
84 if err := pushList(ctx, dockerCli, req); err != nil {
85 return err
86 }
87 if opts.purge {
88 return newManifestStore(dockerCli).Remove(targetRef)
89 }
90 return nil
91}
92
93func buildPushRequest(manifests []types.ImageManifest, targetRef reference.Named, insecure bool) (pushRequest, error) {
94 req := pushRequest{targetRef: targetRef, insecure: insecure}

Callers 1

newPushListCommandFunction · 0.70

Calls 6

normalizeReferenceFunction · 0.85
newManifestStoreFunction · 0.85
buildPushRequestFunction · 0.85
pushListFunction · 0.85
GetListMethod · 0.65
RemoveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…