docker

package
v0.0.0-...-e0497bc Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Zlib Imports: 25 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerCreate

func ContainerCreate(
	config *container.Config,
	hostConfig *container.HostConfig,
	networkingConfig *network.NetworkingConfig,
	platform *specs.Platform,
	containerName string,
) (container.CreateResponse, error)

func ContainerDelete

func ContainerDelete(name string, opts container.RemoveOptions) error

func ContainerKill

func ContainerKill(name string) error

func ContainerRestart

func ContainerRestart(name string) error

func ContainerStart

func ContainerStart(name string, opts container.StartOptions) error

func ContainerStop

func ContainerStop(name string) error

func ContainerWait

func ContainerWait(name string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error)

func CopyGitStackToHost

func CopyGitStackToHost(src, dst string, stackID int, stackName, assetPath string) error

CopyGitStackToHost copies src folder to the dst folder on the host

func CreateSnapshot

func CreateSnapshot(edgeKey string) (*portainer.DockerSnapshot, error)

func GetContainerLogs

func GetContainerLogs(containerName string, tail string) ([]byte, []byte, error)

func GetContainersWithLabel

func GetContainersWithLabel(value string) (r []types.Container, err error)

func ImageDelete

func ImageDelete(name string, opts image.RemoveOptions) (r []image.DeleteResponse, err error)

func ImagePull

func ImagePull(refStr string, options image.PullOptions) (io.ReadCloser, error)

func NewClient

func NewClient() (*client.Client, error)

func RemoveGitStackFromHost

func RemoveGitStackFromHost(src, dst string, stackID int, stackName string) error

RemoveGitStackFromHost removes the copy of src folder on the host

func VolumeDelete

func VolumeDelete(name string, force bool) error

Types

type InfoService

type InfoService struct{}

DockerInfoService is a service used to retrieve information from a Docker environment using the Docker library.

func NewInfoService

func NewInfoService() *InfoService

NewInfoService returns a pointer to an instance of DockerInfoService

func (*InfoService) GetContainerIpFromDockerEngine

func (service *InfoService) GetContainerIpFromDockerEngine(containerName string, ignoreNonSwarmNetworks bool) (string, error)

GetContainerIpFromDockerEngine is used to retrieve the IP address of the container through Docker. It will inspect the container to retrieve the networks associated to the container and returns the IP associated to the first network found that is not an ingress network. If the ignoreNonSwarmNetworks parameter is specified, it will also ignore non Swarm scoped networks.

func (*InfoService) GetRuntimeConfigurationFromDockerEngine

func (service *InfoService) GetRuntimeConfigurationFromDockerEngine() (*agent.RuntimeConfig, error)

GetRuntimeConfigurationFromDockerEngine retrieves information from a Docker environment and returns a map of labels.

func (*InfoService) GetServiceNameFromDockerEngine

func (service *InfoService) GetServiceNameFromDockerEngine(containerName string) (string, error)

GetServiceNameFromDockerEngine is used to return the name of the Swarm service the agent is part of. The service name is retrieved through container labels.

Jump to

Keyboard shortcuts

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