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

Method ImagePush

pkg/dryrun/dryrunclient.go:226–245  ·  view source on GitHub ↗
(ctx context.Context, ref string, options client.ImagePushOptions)

Source from the content-addressed store, hash-verified

224}
225
226func (d *DryRunClient) ImagePush(ctx context.Context, ref string, options client.ImagePushOptions) (client.ImagePushResponse, error) {
227 if _, _, err := d.resolver.Resolve(ctx, ref); err != nil {
228 return nil, err
229 }
230 jsonMessage, err := json.Marshal(&jsonstream.Message{
231 Status: "Pushed",
232 Progress: &jsonstream.Progress{
233 Current: 100,
234 Total: 100,
235 Start: 0,
236 HideCounts: false,
237 Units: "Mb",
238 },
239 ID: ref,
240 })
241 if err != nil {
242 return nil, err
243 }
244 return fakeStreamResult{ReadCloser: io.NopCloser(bytes.NewReader(jsonMessage))}, nil
245}
246
247func (d *DryRunClient) ImageRemove(ctx context.Context, imageName string, options client.ImageRemoveOptions) (client.ImageRemoveResult, error) {
248 return client.ImageRemoveResult{}, nil

Callers 1

pushServiceImageMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected