container

package
v0.0.0-...-ac6e8c9 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBaseDir

func GetBaseDir(rootDir string) string

Types

type Container

type Container struct {
	ID           string
	BaseDir      string
	Image        *image.Image
	Config       *runtimespec.Spec
	Opts         ContainerOpts
	ExposedPorts []network.ExposedPort
	CreatedAt    time.Time
	StartedAt    time.Time
	ExitedAt     time.Time
	LogFilePath  string
	UseFuse      bool
}

func New

func New(rootDir string, img *image.Image, opts ContainerOpts) (*Container, error)

func (*Container) Command

func (c *Container) Command() []string

Command returns the container's command, which is what gets executed in the container when it starts.

func (*Container) Delete

func (c *Container) Delete() error

Delete removes the container base directory and all its files.

func (*Container) IsCreated

func (c *Container) IsCreated() bool

IsCreated returns `true` when the container has been created, and `false` otherwise.

func (*Container) IsExited

func (c *Container) IsExited() bool

IsExited returns `true` when the container has exited, and `false` otherwise.

func (*Container) IsStarted

func (c *Container) IsStarted() bool

IsStarted returns `true` when the container has started, and `false` otherwise.

func (*Container) Mount

func (c *Container) Mount() error

Mount creates a bundle configuration for the container and mounts its root filesystem.

func (*Container) Refresh

func (c *Container) Refresh() error

Refresh reloads the missing container properties (from disk).

func (*Container) Rootfs

func (c *Container) Rootfs() string

Rootfs returns the absolute path to the root filesystem.

func (*Container) Unmount

func (c *Container) Unmount() error

Unmount unmounts the root filesystem of the container.

type ContainerOpts

type ContainerOpts struct {
	Command     []string
	Entrypoint  []string
	Remove      bool
	Hostname    string
	Interactive bool
	Tty         bool
	Detach      bool
	PublishAll  bool
}

Jump to

Keyboard shortcuts

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