docker

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentContext added in v0.10.0

func CurrentContext() (string, error)

func CurrentDockerHost added in v0.10.0

func CurrentDockerHost() (string, error)

func DockerContainerAttach added in v0.12.0

func DockerContainerAttach(ID string, options container.AttachOptions) (types.HijackedResponse, error)

DockerContainerAttach will return an attached response to a container.

func DockerContainerCreate

func DockerContainerCreate(ID string, config container.Config, hostconfig container.HostConfig, networkconfig network.NetworkingConfig) (container.CreateResponse, error)

DockerContainerCreate will create a container, but will not run it.

func DockerContainerList

func DockerContainerList() ([]types.Container, error)

DockerContainerList will return a slice of containers

func DockerContainerLogs

func DockerContainerLogs(ID string) ([]byte, error)

DockerContainerLogs will synchronously (blocking, non-concurrently) print logs to stdout and stderr, useful for quick containers with a small amount of output which are expected to exit quickly.

func DockerContainerStart

func DockerContainerStart(ID string, options container.StartOptions) error

DockerContainerStart will run an existing container.

func DockerContainerWait added in v0.12.0

func DockerContainerWait(ID string, condition container.WaitCondition) error

DockerContainerWait will wait for the specificied container condition.

func DockerExec

func DockerExec(container string, command string) ([]byte, error)

DockerExec will run a command in a Docker container and return the output.

func DockerImageList

func DockerImageList() ([]image.Summary, error)

DockerImageList will return a slice of Docker images.

func DockerInspect

func DockerInspect(container string) (types.ContainerJSON, error)

DockerInspect will return the full container object.

func DockerKill

func DockerKill(name string) error

DockerKill will kill the container.

func DockerNetworkConnect

func DockerNetworkConnect(network string, containerName string) error

DockerNetworkConnect will connect a container to a network.

func DockerNetworkConnected

func DockerNetworkConnected(network string, containerName string) (bool, error)

DockerNetworkConnected will check if a container is connected to a network.

func DockerNetworkCreate

func DockerNetworkCreate(network *types.NetworkResource) error

DockerNetworkCreate is an abstraction layer on top of the Docker API call which will create a Docker network using a specified configuration.

func DockerNetworkGet

func DockerNetworkGet(name string) (types.NetworkResource, error)

DockerNetworkGet will use the Docker API to retrieve a Docker network which has a given name.

func DockerNetworkRemove

func DockerNetworkRemove(network string) error

DockerNetworkRemove will attempt to remove a Docker network and will not apply force to removal.

func DockerNetworkStatus

func DockerNetworkStatus(network string) (bool, error)

DockerNetworkStatus will identify if a network with a specified name is present been created and return a boolean.

func DockerPull

func DockerPull(image string) (string, error)

DockerPull will pull a Docker image into the daemon.

func DockerRemove

func DockerRemove(id string) error

DockerRemove will remove the container. It will not remove the image.

func DockerStop

func DockerStop(name string) error

DockerStop will stop the container.

func DockerVolumeCreate

func DockerVolumeCreate(volumeInput volume.Volume) (volume.Volume, error)

DockerVolumeCreate will create a Docker Volume as configured.

func DockerVolumeExists

func DockerVolumeExists(volume string) (bool, error)

DockerVolumeExists will check if a Docker volume has been created.

func DockerVolumeGet

func DockerVolumeGet(name string) (volume.Volume, error)

DockerVolumeGet will return the full contents of a types.Volume from the API.

func EndpointFromContext added in v0.10.0

func EndpointFromContext(context string) (string, error)

func NewClient added in v0.10.0

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

Types

type DockerConfig added in v0.10.0

type DockerConfig struct {
	CurrentContext string `json:"currentContext"`
}

type DockerContextManifest added in v0.10.0

type DockerContextManifest struct {
	Name      string
	Endpoints map[string]struct {
		Host string
	}
}

Jump to

Keyboard shortcuts

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