container

package
v0.0.0-...-75424bb Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListContainers

func ListContainers()

ListContainers shows the list of existing containers in the host

func Run

func Run()

Run runs a command in a new container

func RunShell

func RunShell()

RunShell opens an interactive bash shell

Types

type Container

type Container struct {
	ProcAttr syscall.SysProcAttr
	ID       int
	Image    string
	Root     string
	Stdin    *os.File
	Stdout   *os.File
	Stderr   *os.File
}

func New

func New(image, root string) *Container

New creates a new instance of a container

func (*Container) Inspect

func (c *Container) Inspect()

Inspect retrieves information about the given container

func (*Container) OpenShell

func (c *Container) OpenShell() error

OpenShell opens an interactive shell in the container

func (*Container) RunCmd

func (c *Container) RunCmd(args ...string) error

RunCmd runs the command passed as CLI argument in the container

type Image

type Image struct {
	Name string
	Hex  string
	Path string
}

Image holds basic information about existing filesystems stored in the host machine

func InspectImage

func InspectImage(name string) (Image, error)

InspectImage returns the relevant information about the specified image if it is found in the root image directory

func ListImages

func ListImages() ([]Image, error)

ListImages retrieves the existing images in the host machine

type ImageManifest

type ImageManifest struct {
	Config   string
	RepoTags []string
	Layers   []string
}

ImageManifest describes the information contained in `manifest.json` for each image

Jump to

Keyboard shortcuts

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