NewImage parses a string into a named reference transforming a familiar name from Docker UI to a fully qualified reference.
(ref string)
| 94 | // NewImage parses a string into a named reference transforming a familiar |
| 95 | // name from Docker UI to a fully qualified reference. |
| 96 | func NewImage(ref string) (Image, error) { |
| 97 | named, err := reference.ParseNormalizedNamed(ref) |
| 98 | if err != nil { |
| 99 | return Image{}, err |
| 100 | } |
| 101 | if named == nil { |
| 102 | return Image{}, fmt.Errorf("invalid image ref %q", ref) |
| 103 | } |
| 104 | return Image{named: named}, nil |
| 105 | } |
| 106 | |
| 107 | // extractImages reads from the bundled Dockerfile to extract the default docker |
| 108 | // image references. |
no outgoing calls
no test coverage detected