istio: istio.io/istio/pkg/test/docker Index | Files | Directories

package docker

import "istio.io/istio/pkg/test/docker"

Index

Package Files

container.go image.go network.go

type Container Uses

type Container struct {
    ContainerConfig

    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      Image
    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 Image Uses

type Image string

func (Image) String Uses

func (i Image) String() string

type ImageBuilder Uses

type ImageBuilder struct {
    // contains filtered or unexported fields
}

ImageBuilder is a utility for creating Docker images.

func NewImageBuilder Uses

func NewImageBuilder() *ImageBuilder

NewImageBuilder creates a new ImageBuilder instance.

func (*ImageBuilder) Add Uses

func (b *ImageBuilder) Add(entryName string, mode os.FileMode, content []byte) *ImageBuilder

Add an entry for the given bytes.

func (*ImageBuilder) AddDir Uses

func (b *ImageBuilder) AddDir(entryName, path string) *ImageBuilder

AddDir adds an entry with all of the files in the given directory (recursively).

func (*ImageBuilder) AddFile Uses

func (b *ImageBuilder) AddFile(entryName, path string) *ImageBuilder

AddFile adds an entry with the contents of the given file.

func (*ImageBuilder) Build Uses

func (b *ImageBuilder) Build(dockerClient *client.Client) (Image, error)

Build the image and return the ID.

func (*ImageBuilder) Copy Uses

func (b *ImageBuilder) Copy() *ImageBuilder

Copy this builder.

func (*ImageBuilder) Tag Uses

func (b *ImageBuilder) Tag(tags ...string) *ImageBuilder

Tag adds the given tags to the image.

type Network Uses

type Network struct {
    NetworkConfig

    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

Directories

PathSynopsis
registry
registry/cmd

Package docker imports 19 packages (graph) and is imported by 3 packages. Updated 2019-08-29. Refresh now. Tools for package owners.