Documentation ¶
Overview ¶
Package docker implements a container manager for docker orchestration.
Index ¶
- type Manager
- func (m *Manager) ContainerList(ctx context.Context, all bool, limit int32, srv options.ListContainerStreamer, ...) error
- func (m *Manager) ContainerLogs(ctx context.Context, instance string, srv options.LogStreamer, ...) error
- func (m *Manager) ContainerPull(ctx context.Context, image, tag string, opts ...options.Option) error
- func (m *Manager) ContainerPush(ctx context.Context, file *os.File, opts ...options.Option) (string, string, error)
- func (m *Manager) ContainerRemove(ctx context.Context, image, tag string, opts ...options.Option) error
- func (m *Manager) ContainerStart(ctx context.Context, image, tag, cmd string, opts ...options.Option) (string, error)
- func (m *Manager) ContainerStop(ctx context.Context, instance string, opts ...options.Option) error
- func (m *Manager) ContainerUpdate(ctx context.Context, instance, image, tag, cmd string, async bool, ...) (string, error)
- func (m *Manager) ImageList(ctx context.Context, all bool, limit int32, srv options.ListImageStreamer, ...) error
- func (m *Manager) ImageRemove(ctx context.Context, image, tag string, opts ...options.Option) error
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) Stop(ctx context.Context) error
- func (m *Manager) VolumeCreate(ctx context.Context, name string, driver cpb.Driver, opts ...options.Option) (string, error)
- func (m *Manager) VolumeList(ctx context.Context, srv options.ListVolumeStreamer, opts ...options.Option) error
- func (m *Manager) VolumeRemove(ctx context.Context, name string, opts ...options.Option) error
- type Vacuum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is a docker container orchestration manager.
func (*Manager) ContainerList ¶
func (m *Manager) ContainerList(ctx context.Context, all bool, limit int32, srv options.ListContainerStreamer, opts ...options.Option) error
ContainerList lists the containers present on the target.
func (*Manager) ContainerLogs ¶
func (m *Manager) ContainerLogs(ctx context.Context, instance string, srv options.LogStreamer, opts ...options.Option) error
ContainerLogs fetches the logs from a container. It can optionally follow the logs and send them back to the client.
func (*Manager) ContainerPull ¶
func (m *Manager) ContainerPull(ctx context.Context, image, tag string, opts ...options.Option) error
ContainerPull pull a container from a registry to this containerz server. Based on the options specified it can tag the container, stream responses to the client, and perform registry authentication.
func (*Manager) ContainerPush ¶
func (m *Manager) ContainerPush(ctx context.Context, file *os.File, opts ...options.Option) (string, string, error)
ContainerPush pushes the container file to the containerz server. It can optionally tag the container, otherwise it will use the name and tag provided in the file.
func (*Manager) ContainerRemove ¶
func (m *Manager) ContainerRemove(ctx context.Context, image, tag string, opts ...options.Option) error
ContainerRemove removes an image provided it is not related to a running container. Otherwise, it returns an error.
Deprecated - use RemoveImage instead.
func (*Manager) ContainerStart ¶
func (m *Manager) ContainerStart(ctx context.Context, image, tag, cmd string, opts ...options.Option) (string, error)
ContainerStart starts a container provided the image exists and that the ports requested are not currently in use.
func (*Manager) ContainerStop ¶
ContainerStop stops a container. If the Force option is set and a timeout is specified in the context, the contains if forcefully terminated after that timeout. If the Force option is set but no timeout is provided the container's StopTimeout value is used, if set, otherwise the engine default. If the Force option is not set, no forceful termination is performed.
func (*Manager) ContainerUpdate ¶
func (m *Manager) ContainerUpdate(ctx context.Context, instance, image, tag, cmd string, async bool, opts ...options.Option) (string, error)
ContainerUpdate updates a running container to the image specified in the request. By default the operation is synchronous which means that the request will only return once the container has either been successfully updated or the update has failed. If the client requests an asynchronous update then the server must perform all validations (e.g. does the requested image exist on the system or does the instance name exist) and return to the client and the update happens asynchronously. It is up to the client to check if the update actually updates the container to the requested version or not. In both synchronous and asynchronous mode, the update process is a break-before-make process as resources bound to the old container must be released prior to launching the new container. If the update fails, the server must restore the previous version of the container. This can either be a start of the previous container or by starting a new container with the old image. It must use the provided StartContainerRequest provided in the params field. If a container exists but is not running should still upgrade the container and start it. The client should only depend on the client being restarted. Any ephemeral state (date written to memory or the filesystem) cannot be depended upon. In particular, the contents of the filesystem are not guaranteed during a rollback.
func (*Manager) ImageList ¶
func (m *Manager) ImageList(ctx context.Context, all bool, limit int32, srv options.ListImageStreamer, opts ...options.Option) error
ImageList lists the images present on the target.
func (*Manager) ImageRemove ¶
ImageRemove removes an image provided it is not related to a running container. Otherwise, it returns an error.
func (*Manager) VolumeCreate ¶
func (m *Manager) VolumeCreate(ctx context.Context, name string, driver cpb.Driver, opts ...options.Option) (string, error)
VolumeCreate creates a volume with the provided name using the driver specified. The driver default to LOCAL if it is not specified. The name is autogenerated by the target if it is empty.