plugin_push.go 486 B

1234567891011121314151617181920
  1. package client // import "github.com/docker/docker/client"
  2. import (
  3. "context"
  4. "io"
  5. "net/http"
  6. "github.com/docker/docker/api/types/registry"
  7. )
  8. // PluginPush pushes a plugin to a registry
  9. func (cli *Client) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) {
  10. resp, err := cli.post(ctx, "/plugins/"+name+"/push", nil, nil, http.Header{
  11. registry.AuthHeader: {registryAuth},
  12. })
  13. if err != nil {
  14. return nil, err
  15. }
  16. return resp.body, nil
  17. }