Documentation ¶
Index ¶
- func DownloadDirFromContainer(client *docker.Client, container, src, dst string) error
- func StreamFileFromContainer(client *docker.Client, container, src string) (io.ReadCloser, error)
- func UploadFileToContainer(client *docker.Client, container, src, dest string) error
- type Helper
- func (h *Helper) CheckAndPull(image string, out io.Writer) error
- func (h *Helper) ContainerLog(container string, numLines int) string
- func (h *Helper) GetContainerState(id string) (container *docker.Container, running bool, 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) Version() (*semver.Version, bool, error)
- 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 ¶
StreamFileFromContainer returns an io.ReadCloser from which the contents of a file in a remote container can be read.
Types ¶
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper provides utility functions to help with Docker
func NewHelper ¶
func NewHelper(client *docker.Client, engineAPIClient *dockerclient.Client) *Helper
NewHelper creates a new Helper
func (*Helper) CheckAndPull ¶
CheckAndPull checks whether a Docker image exists. If not, it pulls it.
func (*Helper) GetContainerState ¶
func (h *Helper) GetContainerState(id string) (container *docker.Container, running bool, err error)
GetContainerState returns whether a container exists and if it does whether it's running
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 ¶
type RegistryConfig ¶
type RegistryConfig struct {
InsecureRegistryCIDRs []string
}
Click to show internal directories.
Click to hide internal directories.