v0.4.5 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2019 License: GPL-3.0 Imports: 19 Imported by: 7




View Source
const ROOTFS = "." + SEPARATOR + "rootfs_overlay"

ROOTFS is our temporary rootfs path

View Source
const SEPARATOR = string(filepath.Separator)

SEPARATOR contains system-specific separator

View Source
const TarCmd = "tar"


This section is empty.


func DownloadAndUnpackImage

func DownloadAndUnpackImage(sourceImage, output string, opts *DownloadOpts) error

func ExtractLayer

func ExtractLayer(opts *ExtractOpts) error

func NewDocker

func NewDocker() (*docker.Client, error)

NewDocker Creates a new instance of *docker.Client, respecting env settings

func PullImage

func PullImage(client *docker.Client, image string) error

PullImage pull the specified image

func Squash

func Squash(client *docker.Client, image string, toImage string) error

Squash Squashes a docker image into another one

func Unpack

func Unpack(client *docker.Client, image string, dirname string, fatal bool) error

Unpack unpacks a docker image into a path

func Untar

func Untar(in io.Reader, dest string, sameOwner bool) error

Untar just a wrapper around the docker functions


type DownloadOpts

type DownloadOpts struct {
	RegistryBase string
	KeepLayers   bool
	UnpackMode   string

type Export

type Export struct {
	Entries map[string]*ExportedImage
	Path    string

func CreateExport

func CreateExport(layers string) (*Export, error)

func (*Export) ExtractLayers

func (e *Export) ExtractLayers(unpackmode string) error

func (*Export) UnPackLayers

func (e *Export) UnPackLayers(order []string, layerDir string, unpackmode string) error

type ExportedImage

type ExportedImage struct {
	Path         string
	JsonPath     string
	VersionPath  string
	LayerTarPath string
	LayerDirPath string

func (*ExportedImage) CreateDirs

func (e *ExportedImage) CreateDirs() error

func (*ExportedImage) ExtractLayerDir

func (e *ExportedImage) ExtractLayerDir(unpackmode string) error

func (*ExportedImage) RemoveLayerDir

func (e *ExportedImage) RemoveLayerDir() error

func (*ExportedImage) TarLayer

func (e *ExportedImage) TarLayer() error

type ExtractOpts

type ExtractOpts struct {
	Source, Destination                string
	Compressed, KeepDirlinks, Rootless bool
	UnpackMode                         string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL