image

package
v0.0.0-...-d5751bf Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	// ID is a unique 64 character identifier of the image
	ID string `json:"id,omitempty"`
	// Parent is the ID of the parent image
	Parent string `json:"parent,omitempty"`
	// Comment is the commit message that was set when committing the image
	Comment string `json:"comment,omitempty"`
	// Created is the timestamp at which the image was created
	Created time.Time `json:"created"`
	// Container is the id of the container used to commit
	Container string `json:"container,omitempty"`
	// ContainerConfig is the configuration of the container that is committed into the image
	ContainerConfig container.Config `json:"container_config,omitempty"`
	// DockerVersion specifies the version of Docker that was used to build the image
	DockerVersion string         `json:"docker_version,omitempty"`
	History       []imageHistory `json:"history,omitempty"`
	// Author is the name of the author that was specified when committing the image
	Author string `json:"author,omitempty"`
	// Config is the configuration of the container received from the client
	Config *container.Config `json:"config,omitempty"`
	// Architecture is the hardware that the image is built and runs on
	Architecture string `json:"architecture,omitempty"`
	// OS is the operating system used to build and run the image
	OS string `json:"os,omitempty"`
	// Size is the total size of the image including all layers it is composed of
	Size   int64        `json:",omitempty"`
	RootFS *imageRootFS `json:"rootfs,omitempty"`
	// contains filtered or unexported fields
}

Image is the image's config object

func NewFromJSON

func NewFromJSON(src []byte) (*Image, error)

NewFromJSON creates an Image configuration from json.

func (*Image) RawJSON

func (img *Image) RawJSON() []byte

RawJSON returns the immutable JSON associated with the image.

type Layer

type Layer interface {
	ID() string
	TarID() string
	ShortID() string
	Index() int
	Command() string
	Size() uint64
	Tree() *filetree.FileTree
	String() string
}

type Manifest

type Manifest struct {
	Config   string   `json:"Config,omitempty"`
	Layers   []string `json:"Layers,omitempty"`
	RepoTags []string `json:"RepoTags,omitempty"`
}

Manifest is the image manifest struct

type Tar

type Tar struct {
	Tag           string
	DockerVersion string
	Created       string
	Manifest      Manifest
	Config        *Image
	Layers        []Layer
	RefTrees      []*filetree.FileTree
	SizeBytes     uint64
	UserSizeByes  uint64 // this is all bytes except for the base image
}

Tar is the image's tar object

func Parse

func Parse(r io.Reader) (*Tar, error)

Parse parses an image tar.gz file

func (*Tar) Extract

func (i *Tar) Extract(r io.Reader, path string, depth int) error

Extract extracts a path from a tar.gz and can handle a set depth of nested tar.gz(s)

func (*Tar) Nodes

func (i *Tar) Nodes() []*widgets.TreeNode

Nodes returns the filetree as widget treenodes

Jump to

Keyboard shortcuts

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