docker

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps the Docker client

func NewClient

func NewClient(dockerSocket string) (*Client, error)

NewClient creates and initializes a Docker client connection

func (*Client) BuildImage

func (c *Client) BuildImage(ctx context.Context, contextPath string, dockerfileName string, tags []string, noCache, pull bool) (types.ImageBuildResponse, error)

BuildImage builds a Docker image from a Dockerfile and context

func (*Client) ContainerLogs

func (c *Client) ContainerLogs(ctx context.Context, containerID string, follow, timestamps bool, tail string) (io.ReadCloser, error)

ContainerLogs retrieves logs from a container

func (*Client) CreateContainer

func (c *Client) CreateContainer(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, name string) (container.CreateResponse, error)

CreateContainer creates a new container

func (*Client) ExecCommand

func (c *Client) ExecCommand(ctx context.Context, containerID string, cmd string) (string, error)

ExecCommand executes a command in a container

func (*Client) InspectContainer

func (c *Client) InspectContainer(ctx context.Context, containerID string) (types.ContainerJSON, error)

InspectContainer retrieves detailed information about a container

func (*Client) InspectImage

func (c *Client) InspectImage(ctx context.Context, imageID string) (types.ImageInspect, error)

InspectImage retrieves detailed information about an image

func (*Client) ListContainers

func (c *Client) ListContainers(ctx context.Context, all bool) ([]types.Container, error)

ListContainers lists all containers

func (*Client) ListImages

func (c *Client) ListImages(ctx context.Context, all bool) ([]image.Summary, error)

ListImages lists local Docker images

func (*Client) PullImage

func (c *Client) PullImage(ctx context.Context, imageName string) (io.ReadCloser, error)

PullImage pulls a Docker image from registry

func (*Client) RemoveContainer

func (c *Client) RemoveContainer(ctx context.Context, containerID string, force, removeVolumes bool) error

RemoveContainer removes a container

func (*Client) RemoveImage

func (c *Client) RemoveImage(ctx context.Context, imageID string, force bool) ([]image.DeleteResponse, error)

RemoveImage removes a Docker image

func (*Client) RestartContainer

func (c *Client) RestartContainer(ctx context.Context, containerID string, timeout *int) error

RestartContainer restarts a container

func (*Client) SearchImages

func (c *Client) SearchImages(ctx context.Context, term string, limit int) ([]registry.SearchResult, error)

SearchImages searches for images on Docker Hub

func (*Client) StartContainer

func (c *Client) StartContainer(ctx context.Context, containerID string) error

StartContainer starts a container

func (*Client) StopContainer

func (c *Client) StopContainer(ctx context.Context, containerID string, timeout *int) error

StopContainer stops a running container

Jump to

Keyboard shortcuts

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