{"modulePath":"github.com/2lambda123/openshift-origin","version":"v3.8.0+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package dockerhelper\n\n## Functions\n\n```go\nfunc DownloadDirFromContainer(client Interface, container, src, dst string) error\n```\nDownloadDirFromContainer downloads an entire directory of files from a remote container.\n\n```go\nfunc StreamFileFromContainer(client Interface, container, src string) (io.ReadCloser, error)\n```\nStreamFileFromContainer returns an io.ReadCloser from which the contents of a file in a remote container can be read.\n\n```go\nfunc UploadFileToContainer(client Interface, container, src, dest string) error\n```\nUploadFileToContainer uploads a file to a remote container.\n\n## Types\n\n```go\ntype Helper struct {\n\t// contains filtered or unexported fields\n}\n```\nHelper provides utility functions to help with Docker\n\n```go\nfunc NewHelper(client Interface) *Helper\n```\nNewHelper creates a new Helper\n\n```go\nfunc (h *Helper) APIVersion() (string, bool, error)\n```\nVersion returns the Docker API version and whether it is a Red Hat distro version\n\n```go\nfunc (h *Helper) CgroupDriver() (string, error)\n```\n\n```go\nfunc (h *Helper) CheckAndPull(image string, out io.Writer) error\n```\nCheckAndPull checks whether a Docker image exists. If not, it pulls it.\n\n```go\nfunc (h *Helper) Client() Interface\n```\n\n```go\nfunc (h *Helper) ContainerLog(container string, numLines int) string\n```\n\n```go\nfunc (h *Helper) DockerRoot() (string, error)\n```\nDockerRoot returns the root directory for Docker\n\n```go\nfunc (h *Helper) GetContainerState(id string) (*types.ContainerJSON, bool, error)\n```\nGetContainerState returns whether a container exists and if it does whether it's running\n\n```go\nfunc (h *Helper) GetDockerProxySettings() (httpProxy, httpsProxy, noProxy string, err error)\n```\n\n```go\nfunc (h *Helper) HostIP() string\n```\nHostIP returns the IP of the Docker host if connecting via TCP\n\n```go\nfunc (h *Helper) InsecureRegistryIsConfigured() (configured bool, hasEntries bool, error error)\n```\nInsecureRegistryIsConfigured checks to see if the Docker daemon has an appropriate insecure registry argument set so that our services can access the registry hasEntries specifies if Docker daemon has entries at all\n\n```go\nfunc (h *Helper) ListContainerNames() ([]string, error)\n```\n\n```go\nfunc (h *Helper) RemoveContainer(id string) error\n```\nRemoveContainer removes the container with the given id\n\n```go\nfunc (h *Helper) StopAndRemoveContainer(container string) error\n```\n\n```go\nfunc (h *Helper) UserNamespaceEnabled() (bool, error)\n```\nUserNamespaceEnabled checks whether docker daemon is running in user namespace mode.\n\n```go\ntype IPV4Range struct {\n\t// contains filtered or unexported fields\n}\n```\nIPV4Range represents a range of ipv4s\n\n```go\nfunc (r IPV4Range) Contains(aRange IPV4Range) bool\n```\nContains returns whether an IPV4Range is contained within another IPV4Range\n\n```go\ntype IPV4RangeList []IPV4Range\n```\nIPV4RangeList represents a collection of IPV4Ranges\n\n```go\nfunc (l IPV4RangeList) Contains(r IPV4Range) bool\n```\nContains returns true if the union of the ranges in this list completely contains the given range\n\n```go\nfunc (l IPV4RangeList) Len() int\n```\nLen returns the length of entries within an IPV4RangeList\n\n```go\nfunc (l IPV4RangeList) Less(i, j int) bool\n```\nLess returns whether a starting ipv4 at index i within this list, is less than a starting ipv4 at index j within this list\n\n```go\nfunc (l IPV4RangeList) Swap(i, j int)\n```\nSwap swaps entries within IPV4RangeList at indices i, and j\n\n```go\ntype Interface interface {\n\tEndpoint() string\n\tInfo() (*types.Info, error)\n\tServerVersion() (*types.Version, error)\n\tContainerCreate(config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, name string) (*types.ContainerCreateResponse, error)\n\tContainerList(options types.ContainerListOptions) ([]types.Container, error)\n\tContainerInspect(container string) (*types.ContainerJSON, error)\n\tContainerRemove(container string, options types.ContainerRemoveOptions) error\n\tContainerLogs(container string, options types.ContainerLogsOptions, stdOut, stdErr io.Writer) error\n\tContainerStart(container string) error\n\tContainerStop(container string, timeout int) error\n\tContainerWait(container string) (int, error)\n\tCopyToContainer(container string, dest string, src io.Reader, options types.CopyToContainerOptions) error\n\tCopyFromContainer(container string, src string) (io.ReadCloser, error)\n\tContainerExecCreate(container string, config types.ExecConfig) (*types.ContainerExecCreateResponse, error)\n\tContainerExecAttach(execID string, stdIn io.Reader, stdOut, stdErr io.Writer) error\n\tContainerExecInspect(execID string) (*types.ContainerExecInspect, error)\n\tImageInspectWithRaw(imageID string, getSize bool) (*types.ImageInspect, []byte, error)\n\tImagePull(ref string, options types.ImagePullOptions, writer io.Writer) error\n}\n```\n\n```go\nfunc NewClient(endpoint string, client *client.Client) Interface\n```\nNewClient creates an instance of the client Interface, given a docker engine client\n\n```go\ntype RegistryConfig struct {\n\t// contains filtered or unexported fields\n}\n```\nRegistryConfig contains useful Docker registry information. Built by NewRegistryConfig constructor\n\n```go\nfunc NewRegistryConfig(dockerInfo *types.Info) *RegistryConfig\n```\nNewRegistryConfig creates a new registry configuration\n\n```go\nfunc (config *RegistryConfig) ContainsInsecureRegistryCIDR(cidr string) (bool, error)\n```\nContainsInsecureRegistryCIDR returns whether a given CIDR is contained within the bounds of at least one CIDR configured in the Docker insecure registry configuration.\n\n```go\nfunc (config *RegistryConfig) HasCustomInsecureRegistryCIDRs() bool\n```\nHasCustomInsecureRegistryCIDRs returns whether the user has any CIDRs configured within the Docker insecure registry configuration. This omits the inferred loopback entry in place implicitly by Docker.\n\n","path":"github.com/2lambda123/openshift-origin/pkg/oc/bootstrap/docker/dockerhelper","name":"dockerhelper","synopsis":"","isRedistributable":true}
