Documentation ¶
Index ¶
- func Get(ctx context.Context, clientInstance client.ContainerAPIClient, id string) (*types.ContainerJSON, error)
- func ListByFilter(ctx context.Context, clientInstance client.ContainerAPIClient, ...) ([]types.Container, error)
- type Container
- func (c *Container) Hash() string
- func (c *Container) ID() (string, error)
- func (c *Container) Image() string
- func (c *Container) ImageConfig() string
- func (c *Container) Info(ctx context.Context) (project.Info, error)
- func (c *Container) IsRunning(ctx context.Context) (bool, error)
- func (c *Container) Kill(ctx context.Context, signal string) error
- func (c *Container) Log(ctx context.Context, l logger.Logger, follow bool) error
- func (c *Container) Name() string
- func (c *Container) Networks() (map[string]*network.EndpointSettings, error)
- func (c *Container) Number() (int, error)
- func (c *Container) Pause(ctx context.Context) error
- func (c *Container) Port(ctx context.Context, port string) (string, error)
- func (c *Container) Remove(ctx context.Context, removeVolume bool) error
- func (c *Container) Rename(ctx context.Context, newName string) error
- func (c *Container) Restart(ctx context.Context, timeout int) error
- func (c *Container) Run(ctx context.Context, configOverride *config.ServiceConfig) (int, error)
- func (c *Container) Start(ctx context.Context) error
- func (c *Container) Stop(ctx context.Context, timeout int) error
- func (c *Container) Unpause(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(ctx context.Context, clientInstance client.ContainerAPIClient, id string) (*types.ContainerJSON, error)
Get looks up the hosts containers with the specified ID or name and returns it, or an error.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container holds information about a docker container and the service it is tied on.
func Create ¶
func Create(ctx context.Context, client client.ContainerAPIClient, name string, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig) (*Container, error)
Create creates a container and return a Container struct (and an error if any)
func NewInspected ¶
func NewInspected(client client.ContainerAPIClient, container *types.ContainerJSON) *Container
NewInspected creates a container struct from an inspected container
func (*Container) Image ¶
Image returns the container image. Depending on the engine version its either the complete id or the digest reference the image.
func (*Container) ImageConfig ¶
ImageConfig returns the container image stored in the config. It's the human-readable name of the image.
func (*Container) IsRunning ¶
IsRunning returns the running state of the container. FIXME(vdemeester): remove the nil error here
func (*Container) Networks ¶
func (c *Container) Networks() (map[string]*network.EndpointSettings, error)
Networks returns the containers network
func (*Container) Pause ¶
Pause pauses the container. If the containers are already paused, don't fail.
func (*Container) Run ¶
Run creates, start and attach to the container based on the image name, the specified configuration. It will always create a new container.