docker

package
v0.0.0-...-f4dd720 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VMLauncherContainerImage = "docker.io/govm/govm:latest"
	VNCContainerImage        = "govm/novnc-server"
)

Container Images

View Source
const (
	VNCServerContainerName = "vm-launcher-novnc-server"
)

Default VM Launcher containers' names

Variables

This section is empty.

Functions

func SetAPIVersion

func SetAPIVersion()

SetAPIVersion gets local docker server API version. nolint: godox TODO: Investigate how we can replace the exec.Command approach

func VerifyNetwork

func VerifyNetwork(ctx context.Context, cli *client.Client, name string) error

VerifyNetwork verifies a docker managed network

Types

type Docker

type Docker struct {
	*client.Client
	// contains filtered or unexported fields
}

Docker stands as a docker service client.

func NewDockerClient

func NewDockerClient() *Docker

NewDockerClient returns a new Docker service client.

func (*Docker) Create

func (d *Docker) Create(containerConfig *container.Config, hostConfig *container.HostConfig,
	networkConfig *network.NetworkingConfig, name string) (string, error)

Create creates a new docker container

func (*Docker) Exec

func (d *Docker) Exec(containerName string, execConfig types.ExecConfig) error

Exec executes commands inside a running container

func (*Docker) ImageExists

func (d *Docker) ImageExists(name string) bool

ImageExists verifies that an image exists in the local docker registry

func (*Docker) Inspect

func (d *Docker) Inspect(id string) (types.ContainerJSON, error)

Inspect inspects and return details about an specific container.

func (*Docker) List

func (d *Docker) List(args filters.Args) ([]types.Container, error)

List lists all docker-based VM instances that mee the passed filters

func (*Docker) PullImage

func (d *Docker) PullImage(image string) error

PullImage pulls image from docker registry

func (*Docker) Remove

func (d *Docker) Remove(id string) error

Remove wraps the ContainerRemove functionality.

func (*Docker) Search

func (d *Docker) Search(name string) (types.Container, error)

Search searches a container from the running docker containers

func (*Docker) Start

func (d *Docker) Start(id, name string) error

Start starts a previously created container.

func (*Docker) Stop

func (d *Docker) Stop(id, name string) error

Stop stops a previously started container.

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine stands an entry point for the docker container services nolint: typecheck

func (Engine) Create

func (e Engine) Create(spec vm.Instance) (id string, err error)

Create create a new instance

func (Engine) Delete

func (e Engine) Delete(namespace, id string) error

Delete deletes an Instance of GoVM

func (*Engine) Init

func (e *Engine) Init()

Init initializes a the Engine's docker client nolint: typecheck

func (Engine) List

func (e Engine) List(namespace string, all bool) ([]vm.Instance, error)

List lists all the Docker container-based VM instances nolint: typecheck

func (*Engine) SSHVM

func (e *Engine) SSHVM(namespace, id, user, key string, term *termutil.Terminal) error

SSHVM initializes the SSH bits for the vm ssh connection nolint: funlen

func (Engine) Save

func (e Engine) Save(namespace, id, outputFile string, stopVM bool) error

Save a Docker container-based VM instance

func (Engine) Start

func (e Engine) Start(namespace, id string) error

Start starts a Docker container-based VM instance

func (Engine) Stop

func (e Engine) Stop(namespace, id string) error

Stop stops a Docker container-based VM instance

type Network

type Network struct {
	Name   string `yaml:"name"`
	Subnet string `yaml:"subnet"`
}

Network is an structure for user-defined networks

Jump to

Keyboard shortcuts

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