Documentation ¶
Index ¶
- func GetDockerAuth(dockerConfig *DockerConfig, imageName string) (string, error)
- type DockerConfig
- type DockerConfigAuth
- type DockerRuntime
- func (d *DockerRuntime) Config() runtime.RuntimeConfig
- func (d *DockerRuntime) CreateContainer(ctx context.Context, node *types.NodeConfig) (string, error)
- func (d *DockerRuntime) CreateNet(ctx context.Context) (err error)
- func (d *DockerRuntime) DeleteContainer(ctx context.Context, cID string) error
- func (d *DockerRuntime) DeleteNet(ctx context.Context) (err error)
- func (d *DockerRuntime) Exec(ctx context.Context, cID string, cmd []string) ([]byte, []byte, error)
- func (d *DockerRuntime) ExecNotWait(_ context.Context, cID string, cmd []string) error
- func (d *DockerRuntime) GetContainer(ctx context.Context, cID string) (*types.GenericContainer, error)
- func (d *DockerRuntime) GetNSPath(ctx context.Context, cID string) (string, error)
- func (*DockerRuntime) GetName() string
- func (d *DockerRuntime) Init(opts ...runtime.RuntimeOption) error
- func (d *DockerRuntime) ListContainers(ctx context.Context, gfilters []*types.GenericFilter) ([]types.GenericContainer, error)
- func (d *DockerRuntime) Mgmt() *types.MgmtNet
- func (d *DockerRuntime) PullImageIfRequired(ctx context.Context, imageName string) error
- func (d *DockerRuntime) StartContainer(ctx context.Context, cID string, node *types.NodeConfig) (interface{}, error)
- func (d *DockerRuntime) StopContainer(ctx context.Context, name string) error
- func (d *DockerRuntime) WithConfig(cfg *runtime.RuntimeConfig)
- func (d *DockerRuntime) WithKeepMgmtNet()
- func (d *DockerRuntime) WithMgmtNet(n *types.MgmtNet)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDockerAuth ¶ added in v0.24.0
func GetDockerAuth(dockerConfig *DockerConfig, imageName string) (string, error)
GetDockerAuth extracts an auth string for the given container image name based on the credentials stored in docker daemon config file
Types ¶
type DockerConfig ¶ added in v0.24.0
type DockerConfig struct {
Auths map[string]DockerConfigAuth `json:"auths,omitempty"`
}
DockerConfig represents the docker config that is typically contained within ~/.docker/config.json
func GetDockerConfig ¶ added in v0.24.0
func GetDockerConfig(configPath string) (*DockerConfig, error)
type DockerConfigAuth ¶ added in v0.24.0
type DockerConfigAuth struct {
Auth string
}
type DockerRuntime ¶
func (*DockerRuntime) Config ¶ added in v0.15.0
func (d *DockerRuntime) Config() runtime.RuntimeConfig
func (*DockerRuntime) CreateContainer ¶
func (d *DockerRuntime) CreateContainer(ctx context.Context, node *types.NodeConfig) (string, error)
CreateContainer creates a docker container (but does not start it)
func (*DockerRuntime) CreateNet ¶
func (d *DockerRuntime) CreateNet(ctx context.Context) (err error)
CreateDockerNet creates a docker network or reusing if it exists
func (*DockerRuntime) DeleteContainer ¶
func (d *DockerRuntime) DeleteContainer(ctx context.Context, cID string) error
DeleteContainer tries to stop a container then remove it
func (*DockerRuntime) DeleteNet ¶
func (d *DockerRuntime) DeleteNet(ctx context.Context) (err error)
DeleteNet deletes a docker bridge
func (*DockerRuntime) Exec ¶
Exec executes cmd on container identified with id and returns stdout, stderr bytes and an error
func (*DockerRuntime) ExecNotWait ¶
ExecNotWait executes cmd on container identified with id but doesn't wait for output nor attaches stdout/err
func (*DockerRuntime) GetContainer ¶ added in v0.15.0
func (d *DockerRuntime) GetContainer(ctx context.Context, cID string) (*types.GenericContainer, error)
func (*DockerRuntime) GetNSPath ¶
GetNSPath inspects a container by its name/id and returns an netns path using the pid of a container
func (*DockerRuntime) GetName ¶ added in v0.15.0
func (*DockerRuntime) GetName() string
func (*DockerRuntime) Init ¶ added in v0.15.0
func (d *DockerRuntime) Init(opts ...runtime.RuntimeOption) error
func (*DockerRuntime) ListContainers ¶
func (d *DockerRuntime) ListContainers(ctx context.Context, gfilters []*types.GenericFilter) ([]types.GenericContainer, error)
ListContainers lists all containers with labels []string
func (*DockerRuntime) Mgmt ¶
func (d *DockerRuntime) Mgmt() *types.MgmtNet
Mgmt return management network struct of a runtime
func (*DockerRuntime) PullImageIfRequired ¶
func (d *DockerRuntime) PullImageIfRequired(ctx context.Context, imageName string) error
func (*DockerRuntime) StartContainer ¶
func (d *DockerRuntime) StartContainer(ctx context.Context, cID string, node *types.NodeConfig) (interface{}, error)
StartContainer starts a docker container
func (*DockerRuntime) StopContainer ¶
func (d *DockerRuntime) StopContainer(ctx context.Context, name string) error
func (*DockerRuntime) WithConfig ¶ added in v0.15.0
func (d *DockerRuntime) WithConfig(cfg *runtime.RuntimeConfig)
func (*DockerRuntime) WithKeepMgmtNet ¶ added in v0.15.0
func (d *DockerRuntime) WithKeepMgmtNet()
func (*DockerRuntime) WithMgmtNet ¶ added in v0.15.0
func (d *DockerRuntime) WithMgmtNet(n *types.MgmtNet)