tools

package
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatFileInDockerImage

func CatFileInDockerImage(c *client.Client, imageName, fileName string) ([]byte, error)

CatFileInDockerImage reads the file fileName inside the given image

func GetDockerCompose

func GetDockerCompose(dockerComposePath string) (result types.DockerCompose, err error)

GetDockerCompose reads docker-compose.yml at the given path and returns the dockerCompose object

func GetExitCode added in v0.28.4

func GetExitCode(containerName string) (int, error)

GetExitCode returns the exit code for the given container

func ListImages

func ListImages(c *client.Client) ([]string, error)

ListImages returns the names of all images and an error (if any)

func ListRunningContainers

func ListRunningContainers(c *client.Client) ([]string, error)

ListRunningContainers returns the names of running containers and an error (if any)

func PullImage

func PullImage(c *client.Client, image string) error

PullImage pulls the given image from DockerHub, returns an error if any

func PushImage

func PushImage(c *client.Client, writer io.Writer, imageName, encodedAuth string) error

PushImage pushes image with imageName to the registry given an encoded auth object

func RunInDockerImage

func RunInDockerImage(imageName, command string) (string, error)

RunInDockerImage runs the given command in a new writeable container layer over the given image, removes the container when the command exits, and returns the output string and an error if any

func TagImage

func TagImage(srcImage, targetImage string) error

TagImage tags a docker image srcImage as targetImage

Types

type RunConfig added in v0.32.0

type RunConfig struct {
	Volumes     []string
	Interactive bool
	WorkingDir  string
	ImageName   string
	Command     []string
	Writer      io.Writer
}

RunConfig holds fields for possible configuration passed to a 'docker run' command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL