dockercommon

package
v0.0.0-...-9451de5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JsonFileLogDriver = "json-file"
)

Variables

This section is empty.

Functions

func AddDeployTarFile

func AddDeployTarFile(archive io.Reader, fileSize int64, name string) io.ReadCloser

func ArchiveBuildCmds

func ArchiveBuildCmds(app provision.App, archiveURL string) []string

ArchiveBuildCmds build a image using the archive method.

func ArchiveDeployCmds

func ArchiveDeployCmds(app provision.App, archiveURL string) []string

ArchiveDeployCmds is a legacy command to deploys an unit using the archive method.

func DeployCmds

func DeployCmds(app provision.App) []string

DeployCmds deploys an unit builded by tsuru.

func DownloadFromContainer

func DownloadFromContainer(client Client, contID string, filePath string) (io.ReadCloser, error)

func GetNodeByHost

func GetNodeByHost(c *cluster.Cluster, host string) (cluster.Node, error)

func LeanContainerCmds

func LeanContainerCmds(processName, imageID string, app provision.App) ([]string, string, error)

func LeanContainerCmdsWithExtra

func LeanContainerCmdsWithExtra(processName, imageID string, app provision.App, extraCmds []string) ([]string, string, error)

func ProcessCmdForImage

func ProcessCmdForImage(processName, imageID string) ([]string, string, error)

func PushImage

func PushImage(client Client, name, tag string, authconfig docker.AuthConfiguration) error

func RegistryAuthConfig

func RegistryAuthConfig(image string) docker.AuthConfiguration

func UserForContainer

func UserForContainer() (username string, uid *int64)

func WaitDocker

func WaitDocker(client *docker.Client) error

Types

type Client

type Client interface {
	PushImage(docker.PushImageOptions, docker.AuthConfiguration) error
	InspectImage(string) (*docker.Image, error)
	TagImage(string, docker.TagImageOptions) error
	CommitContainer(docker.CommitContainerOptions) (*docker.Image, error)
	DownloadFromContainer(string, docker.DownloadFromContainerOptions) error
}

type PullAndCreateClient

type PullAndCreateClient struct {
	*docker.Client
}

func (*PullAndCreateClient) PullAndCreateContainer

func (c *PullAndCreateClient) PullAndCreateContainer(opts docker.CreateContainerOptions, w io.Writer) (*docker.Container, string, error)

func (*PullAndCreateClient) SetTimeout

func (c *PullAndCreateClient) SetTimeout(timeout time.Duration)

Jump to

Keyboard shortcuts

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