build

package
v0.1.3-0...-f63d1a6 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDockerfileName is the Default filename with Docker commands, read by docker build
	DefaultDockerfileName string = "Dockerfile"
)

Variables

This section is empty.

Functions

func GetContextFromGitURL

func GetContextFromGitURL(gitURL, dockerfileName string) (absContextDir, relDockerfile string, err error)

GetContextFromGitURL uses a Git URL as context for a `docker build`. The git repo is cloned into a temporary directory used as the context directory. Returns the absolute path to the temporary context directory, the relative path of the dockerfile in that context directory, and a non-nil error on success.

func GetContextFromLocalDir

func GetContextFromLocalDir(localDir, dockerfileName string) (absContextDir, relDockerfile string, err error)

GetContextFromLocalDir uses the given local directory as context for a `docker build`. Returns the absolute path to the local context directory, the relative path of the dockerfile in that context directory, and a non-nil error on success.

func GetContextFromReader

func GetContextFromReader(r io.ReadCloser, dockerfileName string) (out io.ReadCloser, relDockerfile string, err error)

GetContextFromReader will read the contents of the given reader as either a Dockerfile or tar archive. Returns a tar archive used as a context and a path to the Dockerfile inside the tar.

func GetContextFromURL

func GetContextFromURL(out io.Writer, remoteURL, dockerfileName string) (io.ReadCloser, string, error)

GetContextFromURL uses a remote URL as context for a `docker build`. The remote resource is downloaded as either a Dockerfile or a tar archive. Returns the tar archive used for the context and a path of the dockerfile inside the tar.

func ValidateContextDirectory

func ValidateContextDirectory(srcPath string, excludes []string) error

ValidateContextDirectory checks if all the contents of the directory can be read and returns an error if some files can't be read symlinks which point to non-existing files don't trigger an error

Types

This section is empty.

Jump to

Keyboard shortcuts

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