internal

package
v0.0.0-...-50ffc52 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version release version
	Version = "0.0.0"

	// Commit will be overwritten automatically by the build system
	Commit = "HEAD"
)

Functions

func Build

func Build(cmd *cobra.Command, args []string) error

Build builds an image.

It asks for a path or url or reads from stadnard input and an optional tag to name the image.

func DisplayVersion

func DisplayVersion(cmd *cobra.Command, args []string) error

func Doctor

func Doctor(cmd *cobra.Command, args []string) error

func Exec

func Exec(ctrDigest string, args []string, detach bool) error

Exec runs a command inside an existing container.

It asks for container digest, command and arg to run, and a detach bool. Container digest can be a prefix of digest.

If detach is true, Exec never wait for command to get done and returns.

func FullVersion

func FullVersion() string

FullVersion display the full version and build

func Images

func Images(_ *cobra.Command, _ []string) error

Images gets all available local images and prints them.

func Init

func Init(ctr *container.Container, args []string, detach bool) error

Init will called by Run. It is a hack to fork a whole new Go process inside a new namespace.

If detach was enabled function returns immediately after starting the command and never waits for the result

func Ps

func Ps(cmd *cobra.Command, _ []string) error

Ps gets all running containers and prints them.

func Pull

func Pull(cmd *cobra.Command, args []string) error

Pull pulls an OCI compatible image from a registry

func Rm

func Rm(force bool, args ...string) error

Rm removes an existing container.

It asks for container digest of a container to remove, and a force bool. Container digest can be a prefix of digest.

If force is true, Rm kills the container before removing it.

func Rmi

func Rmi(cmd *cobra.Command, args []string) error

Rmi removes local images.

It asks for an image name or id to remove.

func Run

func Run(copts *ContainerOptions) error

Run runs a command inside a new container.

func Stop

func Stop(kill bool, args ...string) error

Stop stops a running container.

It asks for container digest of a container to stop, and kill bool to optionally kill the container.

Container digest can be a prefix of digest.

If kill is true, Stop kills the container.

Types

type ContainerOptions

type ContainerOptions struct {
	CPUShares  int64
	Detach     bool
	Env        utils.ListOpts
	Entrypoint string
	IP         string
	Hostname   string
	Memory     utils.MemBytes
	Swap       utils.MemSwapBytes
	Name       string
	Pids       int64
	Publish    utils.ListOpts
	AutoRemove bool
	User       string
	Volumes    utils.ListOpts
	WorkDir    string

	Image string
	Args  []string
}

func NewContainerOptions

func NewContainerOptions() *ContainerOptions

Jump to

Keyboard shortcuts

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