Documentation
¶
Overview ¶
docker holds useful things for interacting with docker
Index ¶
- func GetFile(ctx context.Context, cli *Client, cid string, path string) (io.ReadCloser, error)
- type Client
- func (d *Client) Connect(ctx context.Context, cid string) (*Response, error)
- func (d *Client) CreateNetwork(ctx context.Context, req *NetworkRequest) (*NetworkAttachment, error)
- func (d *Client) CreateVolume(ctx context.Context, req *VolumeRequest) (mount.Mount, error)
- func (c *Client) IsSSH() bool
- func (d *Client) Remove(ctx context.Context, resp *Response) error
- func (d *Client) RemoveNetwork(ctx context.Context, nw *NetworkAttachment) error
- func (d *Client) RemoveVolume(ctx context.Context, v mount.Mount) error
- func (d *Client) Run(ctx context.Context, req *Request) (string, error)
- func (d *Client) Start(ctx context.Context, req *Request) (*Response, error)
- type Content
- type DockerAuthConfig
- type DockerConfig
- type NetworkAttachment
- type NetworkRequest
- type Option
- type Request
- type ResourcesRequest
- type Response
- func (r *Response) GetFile(ctx context.Context, path string) (io.Reader, error)
- func (r *Response) PortBinding(port nat.Port) (nat.PortBinding, func(), error)
- func (r *Response) ReadFile(ctx context.Context, path string) ([]byte, error)
- func (r *Response) Run(ctx context.Context, cmd harness.Command) error
- type RunError
- type VolumeRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶ added in v0.0.32
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Connect ¶ added in v0.0.32
Connect returns a response for a container that is already running.
func (*Client) CreateNetwork ¶ added in v0.0.32
func (d *Client) CreateNetwork(ctx context.Context, req *NetworkRequest) (*NetworkAttachment, error)
func (*Client) CreateVolume ¶ added in v0.0.32
func (*Client) Remove ¶ added in v0.0.32
Remove forcibly removes all the resources associated with the given request.
func (*Client) RemoveNetwork ¶ added in v0.0.32
func (d *Client) RemoveNetwork(ctx context.Context, nw *NetworkAttachment) error
func (*Client) RemoveVolume ¶ added in v0.0.32
type Content ¶
func NewContentFromString ¶
type DockerAuthConfig ¶ added in v0.0.86
type DockerConfig ¶ added in v0.0.86
type DockerConfig struct {
Auths map[string]DockerAuthConfig `json:"auths,omitempty"`
}
DockerConfig is the structure of the config file used at ~/.docker/config.json.
func (*DockerConfig) Content ¶ added in v0.0.86
func (d *DockerConfig) Content() (*Content, error)
type NetworkAttachment ¶
type NetworkRequest ¶
type NetworkRequest struct {
// Name is the name of the network to create. If empty, a random name will be
// generated.
Name string
// IPAM is the IP Address Management configuration for the network. Most of
// the time this can be left empty and set by the daemon.
IPAM *network.IPAM
Labels map[string]string
EnableIPv6 bool
}
type Request ¶
type Request struct {
Ref name.Reference
Name string
Entrypoint []string
User string // uid:gid
Env []string
Cmd []string
Labels map[string]string
Privileged bool
Resources ResourcesRequest
Mounts []mount.Mount
Networks []NetworkAttachment
Timeout time.Duration
HealthCheck *container.HealthConfig
Contents []*Content
PortBindings nat.PortMap
CgroupnsMode container.CgroupnsMode
PidMode string
ExtraHosts []string
AutoRemove bool
Logger io.Writer
Init bool
}
type ResourcesRequest ¶
type Response ¶
type Response struct {
types.ContainerJSON
ID string
Name string
// contains filtered or unexported fields
}
Response is returned from a Start() request.
func (*Response) PortBinding ¶ added in v0.0.95
PortBinding returns the host port binding for a container port. For SSH connections, it creates a tunnel and returns a cleanup function. For local connections, it returns the local port and cleanup is a no-op.
Click to show internal directories.
Click to hide internal directories.