Documentation ¶
Index ¶
- func ValidateImage(imageName, imageTag string) error
- type APIClient
- type Client
- func (d *Client) ContainerExec(containerName string, rootUser bool, command []string) (ExecResult, error)
- func (d *Client) ContainerGetMounts(containerName string) []types.MountPoint
- func (d *Client) ContainerList(site string) ([]types.Container, error)
- func (d *Client) ContainerRestart(containerName string) (bool, error)
- func (d *Client) ContainerRun(config *ContainerConfig, randomPorts, localUser bool) (id string, err error)
- func (d *Client) ContainerRunAndClean(config *ContainerConfig, interactive bool) (statusCode int64, body string, err error)
- func (d *Client) ContainerStop(containerName string) (bool, error)
- func (d *Client) EnsureImage(imageName, appDirectory string, updateDays int64, ...) (err error)
- func (d *Client) EnsureNetwork(name string) (created bool, dockerNetwork network.Inspect, err error)
- func (d *Client) RemoveNetwork(name string) (removed bool, err error)
- type ContainerAPIClient
- type ContainerConfig
- type Context
- type ExecResult
- type ExposedPorts
- type ImageAPIClient
- type NetworkAPIClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateImage ¶
Types ¶
type APIClient ¶
type APIClient interface { ContainerAPIClient ImageAPIClient NetworkAPIClient }
APIClient is an interface that clients that talk with a docker server must implement.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an interface the must be implemented to provide Docker services through this package.
func (*Client) ContainerExec ¶
func (*Client) ContainerGetMounts ¶
func (d *Client) ContainerGetMounts(containerName string) []types.MountPoint
ContainerGetMounts Returns a slice containing all the mounts to the given container.
func (*Client) ContainerList ¶
ContainerList Lists all running containers for a given site or all sites if no site is specified.
func (*Client) ContainerRestart ¶
func (*Client) ContainerRun ¶
func (d *Client) ContainerRun(config *ContainerConfig, randomPorts, localUser bool) (id string, err error)
func (*Client) ContainerRunAndClean ¶
func (*Client) EnsureImage ¶
func (d *Client) EnsureImage(imageName, appDirectory string, updateDays int64, consoleOutput *console.Console) (err error)
https://gist.github.com/miguelmota/4980b18d750fb3b1eb571c3e207b1b92 https://riptutorial.com/docker/example/31980/image-pulling-with-progress-bars--written-in-go
func (*Client) EnsureNetwork ¶
type ContainerAPIClient ¶
type ContainerAPIClient interface { ContainerCreate( ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (container.CreateResponse, error) ContainerAttach(ctx context.Context, container string, options container.AttachOptions) (types.HijackedResponse, error) ContainerExecAttach(ctx context.Context, execID string, config container.ExecAttachOptions) (types.HijackedResponse, error) ContainerExecCreate(ctx context.Context, container string, config container.ExecOptions) (types.IDResponse, error) ContainerExecInspect(ctx context.Context, execID string) (container.ExecInspect, error) ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error) ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error) ContainerLogs(ctx context.Context, container string, options container.LogsOptions) (io.ReadCloser, error) ContainerRemove(ctx context.Context, container string, options container.RemoveOptions) error ContainerStart(ctx context.Context, container string, options container.StartOptions) error ContainerStop(ctx context.Context, name string, options container.StopOptions) error ContainerWait( ctx context.Context, container string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error) }
ContainerAPIClient defines API client methods for the containers.
type ContainerConfig ¶
type ExecResult ¶
type ExposedPorts ¶
type ImageAPIClient ¶
type ImageAPIClient interface { ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error) ImageRemove(ctx context.Context, image string, options image.RemoveOptions) ([]image.DeleteResponse, error) ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error) }
ImageAPIClient defines API client methods for the images.
type NetworkAPIClient ¶
type NetworkAPIClient interface { NetworkCreate(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error) NetworkList(ctx context.Context, options network.ListOptions) ([]network.Inspect, error) NetworkRemove(ctx context.Context, network string) error }
NetworkAPIClient defines API client methods for the networks.