Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseDockerfile ¶
func ParseDockerfile(opts *config.WarmerOptions) ([]string, error)
Types ¶
type FetchLocalSource ¶
FetchLocalSource retrieves a Docker image manifest from a local source. github.com/GoogleContainerTools/kaniko/cache.LocalSource can be used as this type.
type FetchRemoteImage ¶
type FetchRemoteImage func(image string, opts config.RegistryOptions, customPlatform string) (v1.Image, error)
FetchRemoteImage retrieves a Docker image manifest from a remote source. github.com/GoogleContainerTools/kaniko/image/remote.RetrieveRemoteImage can be used as this type.
type OciWarmer ¶
type OciWarmer struct {
Remote FetchRemoteImage
Local FetchLocalSource
TmpDir string
}
type Warmer ¶
type Warmer struct {
Remote FetchRemoteImage
Local FetchLocalSource
TarWriter io.Writer
ManifestWriter io.Writer
}
Warmer is used to prepopulate the cache with a Docker image
func (*Warmer) Warm ¶
Warm retrieves a Docker image and populates the supplied buffer with the image content and manifest or returns an AlreadyCachedErr if the image is present in the cache.
Example ¶
tarBuf := new(bytes.Buffer)
manifestBuf := new(bytes.Buffer)
w := &Warmer{
Remote: remote.RetrieveRemoteImage,
Local: cache.LocalSource,
TarWriter: tarBuf,
ManifestWriter: manifestBuf,
}
options := &config.WarmerOptions{}
digest, err := w.Warm("ubuntu:latest", options)
if err != nil {
if !cache.IsAlreadyCached(err) {
log.Fatal(err)
}
}
log.Printf("digest %v tar len %d\nmanifest:\n%s\n", digest, tarBuf.Len(), manifestBuf.String())
Click to show internal directories.
Click to hide internal directories.