Documentation ¶
Overview ¶
Package crane holds libraries used to implement the crane CLI.
Example ¶
package main import ( "fmt" "github.com/google/go-containerregistry/pkg/crane" ) func main() { c := map[string][]byte{ "/binary": []byte("binary contents"), } i, _ := crane.Image(c) d, _ := i.Digest() fmt.Println(d) }
Output: sha256:09fb0c6289cefaad8c74c7e5fd6758ad6906ab8f57f1350d9f4eb5a7df45ff8b
Index ¶
- func Append(base v1.Image, paths ...string) (v1.Image, error)
- func Catalog(src string, opt ...Option) (res []string, err error)
- func Config(ref string, opt ...Option) ([]byte, error)
- func Copy(src, dst string, opt ...Option) error
- func Delete(src string, opt ...Option) error
- func Digest(ref string, opt ...Option) (string, error)
- func Export(img v1.Image, w io.Writer) error
- func Image(filemap map[string][]byte) (v1.Image, error)
- func Insecure(o *Options)
- func Layer(filemap map[string][]byte) (v1.Layer, error)
- func ListTags(src string, opt ...Option) ([]string, error)
- func Load(path string) (v1.Image, error)
- func Manifest(ref string, opt ...Option) ([]byte, error)
- func Pull(src string, opt ...Option) (v1.Image, error)
- func PullLayer(ref string, opt ...Option) (v1.Layer, error)
- func Push(img v1.Image, dst string, opt ...Option) error
- func Save(img v1.Image, src, path string) error
- func SaveLegacy(img v1.Image, src, path string) error
- func SaveOCI(img v1.Image, path string) error
- func Tag(img, tag string, opt ...Option) error
- type Option
- type Options
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Image ¶
Image creates a image with the given filemaps as its contents. These images are reproducible and consistent. A filemap is a path -> file content map representing a file system.
func Insecure ¶
func Insecure(o *Options)
Insecure is an Option that allows image references to be fetched without TLS.
func Layer ¶
Layer creates a layer from a single file map. These layers are reproducible and consistent. A filemap is a path -> file content map representing a file system.
func SaveLegacy ¶
SaveLegacy writes the v1.Image img as a legacy tarball at path with tag src.
Types ¶
type Option ¶
type Option func(*Options)
Option is a functional option for crane.
func WithTransport ¶
func WithTransport(t http.RoundTripper) Option
WithTransport is a functional option for overriding the default transport for remote operations.