istio: Index | Files

package docker

import ""


Package Files

container.go network.go

type Container Uses

type Container struct {

    IPAddress string
    // contains filtered or unexported fields

Container is a wrapper around a Docker container.

func NewContainer Uses

func NewContainer(dockerClient *client.Client, config ContainerConfig) (*Container, error)

NewContainer creates and starts a new Container instance.

func (*Container) Close Uses

func (c *Container) Close() error

Close stops and removes this container.

func (*Container) Exec Uses

func (c *Container) Exec(ctx context.Context, cmd ...string) (ExecResult, error)

Exec runs the given command on this container.

func (*Container) Logs Uses

func (c *Container) Logs() (string, error)

type ContainerConfig Uses

type ContainerConfig struct {
    Name       string
    Image      string
    Aliases    []string
    PortMap    PortMap
    EntryPoint []string
    Cmd        []string
    Env        []string
    Hostname   string
    CapAdd     []string
    Privileged bool
    ExtraHosts []string
    Network    *Network
    Labels     map[string]string

ContainerConfig for a Container.

type ContainerPort Uses

type ContainerPort int

type ExecResult Uses

type ExecResult struct {
    StdOut   []byte
    StdErr   []byte
    ExitCode int

type HostPort Uses

type HostPort int

type Network Uses

type Network struct {

    Subnet *net.IPNet
    // contains filtered or unexported fields

Network is an instance of a user-defined Docker network.

func NewNetwork Uses

func NewNetwork(dockerClient *client.Client, cfg NetworkConfig) (out *Network, err error)

NewNetwork creates a new user-defined Docker network.

func (*Network) Close Uses

func (n *Network) Close() error

Close removes this network. All attached containers must already have been stopped.

type NetworkConfig Uses

type NetworkConfig struct {
    Name   string
    Labels map[string]string

type PortMap Uses

type PortMap map[ContainerPort]HostPort

Package docker imports 14 packages (graph) and is imported by 4 packages. Updated 2020-04-05. Refresh now. Tools for package owners.