Documentation
¶
Index ¶
- func CopyToContainer(containerId string, path string, contents io.Reader) error
- func GetClient() *client.Client
- func RemoveContainer(containerId string, force bool) error
- func RunCommand(containerId string, command []string) (string, error)
- func RunShellCommand(containerId string, command string) (string, error)
- type Container
- func (c *Container) CopyTo(path string, contents io.Reader) error
- func (c *Container) ID() string
- func (c *Container) Remove(force bool) (err error)
- func (c *Container) RunCommand(command []string) (output string, err error)
- func (c *Container) RunShellCommand(command string) (output string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyToContainer ¶
CopyToContainer copies the given contents to the container with containerId
func GetClient ¶
GetClient returns a new docker client created from the current environment the client is created if not already
func RemoveContainer ¶
RemoveContainer removes the container with containerId. force allows a running container to be forcefully removed.
func RunCommand ¶
RunCommand executes the given command with arguments inside the container with containerId
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container represents a docker container and the operations that can be run on it
func ContainerFromId ¶
ContainerFromId returns a new Container instance from the given container id
func StartContainer ¶
func StartContainer(image string, entrypoint []string, cmd []string, mounts []mount.Mount) (*Container, error)
StartContainer starts a container with the given image, entrypoint, cmd and host mounts it wraps the container ID in a Container instance and returns it
func (*Container) Remove ¶
Remove removes the container. force allows a running container to be forcefully removed.
func (*Container) RunCommand ¶
RunCommand executes the given command with arguments inside the container