Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeserializedTar ¶
type DeserializedTar struct {
Content map[string]*TarEntry // map of path -> entry
Order []string // paths in the order they are read in the stream
}
DeserializedTar represents a deserialized tar stream
func NewDeserializedTar ¶
func NewDeserializedTar() *DeserializedTar
NewDeserializedTar returns an initialized empty DeserializedTar
func (*DeserializedTar) Append ¶
func (dt *DeserializedTar) Append(te *TarEntry) error
Append adds a new entry to the end of the tar stream
func (*DeserializedTar) Remove ¶
func (dt *DeserializedTar) Remove(p string) error
Remove deletes the entry p from the tar file
type DockerImageConfig ¶
type DockerImageConfig struct {
Architecture string `json:"architecture"`
Config map[string]interface{} `json:"config"`
Container string `json:"container"`
ContainerConfig map[string]interface{} `json:"container_config"`
Created string `json:"created"`
DockerVersion string `json:"docker_version"`
History []map[string]interface{} `json:"history"`
OS string `json:"os"`
RootFS struct {
Type string `json:"type"`
DiffIDs []string `json:"diff_ids"`
} `json:"rootfs"`
}
DockerImageConfig represents the image config json file in the root of an image archive
type DockerImageManifest ¶
DockerImageManifest represents manifest.json in the root of an image archive
type DockerImageSquasher ¶
type DockerImageSquasher struct {
// contains filtered or unexported fields
}
DockerImageSquasher squashes an image repository to its last layer
func (*DockerImageSquasher) DeserializeTarStream ¶
func (dis *DockerImageSquasher) DeserializeTarStream(ctx context.Context, in io.Reader) (*DeserializedTar, int64, error)
DeserializeTarStream deserializes a tar stream returns the struct and the total bytes read (not including tar metadata)
type DockerLayerJSON ¶
type DockerLayerJSON struct {
ID string `json:"id"`
Parent string `json:"parent,omitempty"`
Created string `json:"created"`
Container string `json:"container"`
ContainerConfig map[string]interface{} `json:"container_config"`
DockerVersion string `json:"docker_version"`
Config map[string]interface{} `json:"config"`
Architecture string `json:"architecture"`
OS string `json:"os"`
}
DockerLayerJSON represents the 'json' file within a layer in an image archive
type ImageSquasher ¶
ImageSquasher represents an object capable of squashing a container image
func NewDockerImageSquasher ¶
func NewDockerImageSquasher(logger *log.Logger) ImageSquasher
NewDockerImageSquasher returns a Docker Image Squasher using the specified logger
type SquashInfo ¶
type SquashInfo struct {
InputBytes uint64
OutputBytes uint64
SizeDifference int64
SizePctDifference float64
FilesRemovedCount uint
FilesRemoved []WhiteoutFile
LayersRemoved uint
}
SquashInfo represents data about an individual squashing operation
type TarEntry ¶
type TarEntry struct {
Header *tar.Header // tar header
Contents []byte // file contents
Index uint64 // index within the stream
}
TarEntry represents a deserialized tar entry
type WhiteoutFile ¶
type WhiteoutFile struct {
Name string // Name of target removed file
Size uint64 // Size in bytes
}
WhiteoutFile represents a file that was removed from final squashed image via whiteout