Documentation
¶
Index ¶
- func BuildVersionString() string
- func ChainCommands(commands []*exec.Cmd) error
- func CheckTag(v string) error
- func DockerComposeCommand(args ...string) *exec.Cmd
- func DockerComposeHasService(service string) bool
- func DockerComposeServiceId(serviceName string) (string, error)
- func DockerComposeServiceIsRunning(serviceName string) (bool, error)
- func DockerComposeServices() (services []string)
- func DockerContainerDyanmicPorts(id string) (map[string]string, error)
- func DockerContainerExists(name string) bool
- func DockerContainerIsRunning(id string) (bool, error)
- func DockerImageExists(image string, tag string) (bool, error)
- func DockerIp() (string, error)
- func DockerfileImages(root string) (images []string)
- func EnsureDockerConnectivity() error
- func ExtractTagFromBranch(gitBranch string) (string, error)
- func ExtractTagFromTag(gitTag string) (string, error)
- func GetDockerClient() *docker.Client
- func GetDockerComposeVersion(c *cli.Context) (string, []int, error)
- func GetDockerVersion() (string, []int, error)
- func HasDockerfile() bool
- func IsStableBranch(gitBranch string) bool
- func PullDockerImage(image string, tag string) error
- func RemoveContainersOfImage(image string) error
- func RunCommand(command *exec.Cmd) error
- func RunCommandWithFilter(command *exec.Cmd, filter dropFilterFunc) error
- func RunCommandWithOutput(command *exec.Cmd) (string, error)
- func Version() string
- type ComposeFileVersion
- type DockerComposeMap
- type DockerComposeNetwork
- type DockerComposeNetworkMap
- type DockerComposeService
- type DockerComposeV2
- type DockerDataContainer
- type DockerImageString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildVersionString ¶
func BuildVersionString() string
BuildVersionString builds a version string containing both the version and the build
func ChainCommands ¶
func DockerComposeCommand ¶
func DockerComposeHasService ¶
func DockerComposeServiceId ¶
func DockerComposeServices ¶
func DockerComposeServices() (services []string)
func DockerContainerExists ¶
func DockerImageExists ¶
DockerImageExists returns true if docker image:tag exists in local docker daemon
func DockerfileImages ¶
func EnsureDockerConnectivity ¶
func EnsureDockerConnectivity() error
EnsureDockerConnectivity will return an error if the docker daemon is not accessible
func ExtractTagFromBranch ¶
* extract tag name from branch * branch: `master` becomes tag `latest` * branch: `origin/release/xxx` becomes tag `xxx` * branch: `origin/aaa/xxx` becomes tag `snapshot.aaa.xxx` * branch: `origin/xxx` becomes tag `snapshot.xxx`
func ExtractTagFromTag ¶
extractTagFromTag will extract the docker tag from the git tag
gitTag must be of format 'v.X.Y.Z-q', where X, Y, and Z are ints and q is some character-baed qualifier. example: v0.2.2, v0.2.3-rc1
func GetDockerClient ¶
func GetDockerClient() *docker.Client
func GetDockerComposeVersion ¶
GetDockerComposeVersion returns version of the docker-compose binary first return value is the human readable version second return value is an array of the {majorVersion, minorVersion, patchVersion}
func GetDockerVersion ¶
GetDockerVersion returns version of the docker binary first return value is the human readable version second return value is an array of the {majorVersion, minorVersion, patchVersion}
func HasDockerfile ¶
func HasDockerfile() bool
func IsStableBranch ¶
func PullDockerImage ¶
PullDockerImage blindly pulls the image:tag
func RemoveContainersOfImage ¶
RemoveContainersOfImage will remove all containers created from the provided image
func RunCommand ¶
func RunCommandWithFilter ¶
Types ¶
type ComposeFileVersion ¶
type ComposeFileVersion int
ComposeFileVersion inside the repo
const ( V1 ComposeFileVersion V2 )
func GetComposeFileVersion ¶
func GetComposeFileVersion(file string, defaultVersion ComposeFileVersion) ComposeFileVersion
GetComposeFileVersion of the current repo Will return the defaultVersion if it cannot determine the actual version
type DockerComposeMap ¶
type DockerComposeMap map[string]DockerComposeService
type DockerComposeNetwork ¶
type DockerComposeNetwork struct {
Driver string
}
type DockerComposeNetworkMap ¶
type DockerComposeNetworkMap map[string]DockerComposeNetwork
type DockerComposeService ¶
type DockerComposeV2 ¶
type DockerComposeV2 struct { Version string Services DockerComposeMap Networks DockerComposeNetworkMap }
type DockerDataContainer ¶
func (*DockerDataContainer) Create ¶
func (ddc *DockerDataContainer) Create() error
func (*DockerDataContainer) Ensure ¶
func (ddc *DockerDataContainer) Ensure(offline bool) error
type DockerImageString ¶
type DockerImageString string
func DockerImage ¶
func DockerImage(dockerfile string) (DockerImageString, error)
func (DockerImageString) IsRemote ¶
func (s DockerImageString) IsRemote() bool
func (DockerImageString) String ¶
func (s DockerImageString) String() string