plugin_push.go 446 B

12345678910111213141516
  1. package client // import "github.com/docker/docker/client"
  2. import (
  3. "context"
  4. "io"
  5. )
  6. // PluginPush pushes a plugin to a registry
  7. func (cli *Client) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) {
  8. headers := map[string][]string{"X-Registry-Auth": {registryAuth}}
  9. resp, err := cli.post(ctx, "/plugins/"+name+"/push", nil, nil, headers)
  10. if err != nil {
  11. return nil, err
  12. }
  13. return resp.body, nil
  14. }