docker

package
v0.0.0-...-cae6a2d Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Docker command
	Docker = "docker"

	// Image used to run containers
	Image = "busybox"

	// DebianImage is the debian image
	DebianImage = "debian"

	// FedoraImage is the fedora image
	FedoraImage = "fedora"

	// Fedora30Image is the fedora 30 image
	// This Fedora version is used mainly because of https://github.com/kata-containers/tests/issues/2358
	Fedora30Image = "fedora:30"

	// StressImage is the vish/stress image
	StressImage = "vish/stress"

	// StressDockerFile is the dockerfile to build vish/stress image
	StressDockerFile = "src/github.com/kata-containers/tests/stress/."

	// VersionsPath is the path for the versions.yaml
	VersionsPath = "src/github.com/kata-containers/tests/versions.yaml"
)
View Source
const (
	// CentosImage is the centos image
	CentosImage = "centos"
)

Variables

View Source
var AlpineImage string

AlpineImage is the alpine image

Functions

func ExistDockerContainer

func ExistDockerContainer(name string) bool

ExistDockerContainer returns true if any of next cases is true: - 'docker ps -a' command shows the container - the VM is running (qemu) - the proxy is running - the shim is running else false is returned

func ExitCodeDockerContainer

func ExitCodeDockerContainer(name string, waitForExit bool) (int, error)

ExitCodeDockerContainer returns the container exit code

func IsRunningDockerContainer

func IsRunningDockerContainer(name string) bool

IsRunningDockerContainer inspects a container returns true if is running

func KillDockerContainer

func KillDockerContainer(name string) bool

KillDockerContainer kills a container

func LogsDockerContainer

func LogsDockerContainer(name string) (string, error)

LogsDockerContainer returns the container logs

func RemoveDockerContainer

func RemoveDockerContainer(name string) bool

RemoveDockerContainer removes a container using docker rm -f

func StatusDockerContainer

func StatusDockerContainer(name string) string

StatusDockerContainer returns the container status

func StopDockerContainer

func StopDockerContainer(name string) bool

StopDockerContainer stops a container

func WaitForRunningDockerContainer

func WaitForRunningDockerContainer(name string, running bool) error

WaitForRunningDockerContainer verifies if a docker container is running for a certain period of time returns an error if the timeout is reached.

Types

type Versions

type Versions struct {
	Docker versionDockerImages `yaml:"docker_images"`
}

Versions will be used to parse the versions yaml

Jump to

Keyboard shortcuts

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