PushOptions returns the parameters needed to push an image.
(out io.Writer, json bool)
| 39 | |
| 40 | // PushOptions returns the parameters needed to push an image. |
| 41 | func (i Image) PushOptions(out io.Writer, json bool) docker.PushImageOptions { |
| 42 | if i.image == nil { |
| 43 | return docker.PushImageOptions{} |
| 44 | } |
| 45 | name := strings.TrimPrefix(fullName(i.image), "docker.io/") |
| 46 | opts := docker.PushImageOptions{ |
| 47 | Name: name, |
| 48 | Registry: hostname(i.image), |
| 49 | OutputStream: out, |
| 50 | RawJSONStream: json, |
| 51 | } |
| 52 | |
| 53 | if i.tag { |
| 54 | opts.Tag = i.image.Tag() |
| 55 | } |
| 56 | return opts |
| 57 | } |
| 58 | |
| 59 | // Equal returns if one image is the same as another |
| 60 | func (i *Image) Equal(other *Image) bool { |