Documentation ¶
Index ¶
- func DownloadDirFromContainer(client Interface, container, src, dst string) error
- func StreamFileFromContainer(client Interface, container, src string) (io.ReadCloser, error)
- func UploadFileToContainer(client Interface, container, src, dest string) error
- type Helper
- func (h *Helper) APIVersion() (string, bool, error)
- func (h *Helper) CgroupDriver() (string, error)
- func (h *Helper) CheckAndPull(image string, out io.Writer) error
- func (h *Helper) Client() Interface
- func (h *Helper) ContainerLog(container string, numLines int) string
- func (h *Helper) DockerRoot() (string, error)
- func (h *Helper) GetContainerState(id string) (*types.ContainerJSON, bool, error)
- func (h *Helper) GetDockerProxySettings() (httpProxy, httpsProxy, noProxy string, err error)
- func (h *Helper) HasInsecureRegistryArg() (bool, error)
- func (h *Helper) HostIP() string
- func (h *Helper) ListContainerNames() ([]string, error)
- func (h *Helper) RemoveContainer(id string) error
- func (h *Helper) StopAndRemoveContainer(container string) error
- func (h *Helper) UserNamespaceEnabled() (bool, error)
- type Interface
- type RegistryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadDirFromContainer ¶
DownloadDirFromContainer downloads an entire directory of files from a remote container.
func StreamFileFromContainer ¶
func StreamFileFromContainer(client Interface, container, src string) (io.ReadCloser, error)
StreamFileFromContainer returns an io.ReadCloser from which the contents of a file in a remote container can be read.
func UploadFileToContainer ¶
UploadFileToContainer uploads a file to a remote container.
Types ¶
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper provides utility functions to help with Docker
func (*Helper) APIVersion ¶
Version returns the Docker API version and whether it is a Red Hat distro version
func (*Helper) CgroupDriver ¶
func (*Helper) CheckAndPull ¶
CheckAndPull checks whether a Docker image exists. If not, it pulls it.
func (*Helper) DockerRoot ¶
DockerRoot returns the root directory for Docker
func (*Helper) GetContainerState ¶
GetContainerState returns whether a container exists and if it does whether it's running
func (*Helper) GetDockerProxySettings ¶
func (*Helper) HasInsecureRegistryArg ¶
HasInsecureRegistryArg checks whether the docker daemon is configured with the appropriate insecure registry argument
func (*Helper) ListContainerNames ¶
func (*Helper) RemoveContainer ¶
RemoveContainer removes the container with the given id
func (*Helper) StopAndRemoveContainer ¶
func (*Helper) UserNamespaceEnabled ¶
UserNamespaceEnabled checks whether docker daemon is running in user namespace mode.
type Interface ¶
type Interface interface { Endpoint() string Info() (*types.Info, error) ServerVersion() (*types.Version, error) ContainerCreate(config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, name string) (*types.ContainerCreateResponse, error) ContainerList(options types.ContainerListOptions) ([]types.Container, error) ContainerInspect(container string) (*types.ContainerJSON, error) ContainerRemove(container string, options types.ContainerRemoveOptions) error ContainerLogs(container string, options types.ContainerLogsOptions, stdOut, stdErr io.Writer) error ContainerStart(container string) error ContainerStop(container string, timeout int) error ContainerWait(container string) (int, error) CopyToContainer(container string, dest string, src io.Reader, options types.CopyToContainerOptions) error CopyFromContainer(container string, src string) (io.ReadCloser, error) ContainerExecCreate(container string, config types.ExecConfig) (*types.ContainerExecCreateResponse, error) ContainerExecAttach(execID string, stdIn io.Reader, stdOut, stdErr io.Writer) error ContainerExecInspect(execID string) (*types.ContainerExecInspect, error) ImageInspectWithRaw(imageID string, getSize bool) (*types.ImageInspect, []byte, error) ImagePull(ref string, options types.ImagePullOptions, writer io.Writer) error }
type RegistryConfig ¶
type RegistryConfig struct {
InsecureRegistryCIDRs []string
}