docker

package
v0.0.0-...-e0e50ec Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Strings for ContainterHealth
	Container_Healthy   = "healthy"
	Container_Unhealthy = "unhealthy"
)

Variables

This section is empty.

Functions

func ContainerRestart

func ContainerRestart(containerID string) error

ContainerRestart restarts the container corresponding to given containerID

func ContainerStats

func ContainerStats(containerID string) (*types.Stats, error)

ContainerStats returns container statistics using the containerID

func CopyToContainer

func CopyToContainer(containerID, destination string, reader io.Reader) error

CopyToContainer copies the file from source path to the destination path inside the container Reader must be a tar archive

func CreateApplicationContainer

func CreateApplicationContainer(containerCfg types.ApplicationContainer) (string, error)

CreateApplicationContainer creates a new container of the given container options, returns id of the container created

func CreateDatabaseContainer

func CreateDatabaseContainer(containerCfg types.DatabaseContainer) (string, error)

CreateDatabaseContainer function creates a new container of the given container options, returns id of the container created

func DeleteContainer

func DeleteContainer(containerID string) error

DeleteContainer deletes a docker container

func DirectPull

func DirectPull(image string) error

DirectPull function directly pulls an image from DockerHUB using os/exec

func ExecDetachedProcess

func ExecDetachedProcess(containerID string, command []string) (string, error)

ExecDetachedProcess executes a command in detached form, returns the id of the process Command of the exec format: mkdir folder => ["mkdir", "folder"]

func ExecProcess

func ExecProcess(containerID string, command []string) (string, error)

ExecProcess executes a command in a blocing manner and returns the id of the process

func InspectContainerHealth

func InspectContainerHealth(containerID string) (string, error)

ContainerHealth returns the health status of the container

func InspectContainerState

func InspectContainerState(containerID string) (*dockerTypes.ContainerState, error)

InspectContainerState returns the state of the container using the containerID

func ListContainers

func ListContainers() ([]string, error)

ListContainers lists all containers

func ListImages

func ListImages() ([]string, error)

ListImages function returns a list of docker images present in the system

func NewClient

func NewClient() *client.Client

NewClient returns a new docker client

func Pull

func Pull(image string) error

Pull function pulls an image from DockerHUB

func ReadLogs

func ReadLogs(containerID, tail string) ([]string, error)

ReadLogs returns the logs from a docker container

func StartContainer

func StartContainer(containerID string) error

StartContainer starts the container corresponding to given containerID

func StopContainer

func StopContainer(containerID string) error

StopContainer stops the container corresponding to given containerID

Types

This section is empty.

Jump to

Keyboard shortcuts

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