Documentation ¶
Index ¶
- Constants
- func GetContextFromGitURL(gitURL, dockerfileName string) (absContextDir, relDockerfile string, err error)
- func GetContextFromLocalDir(localDir, dockerfileName string) (absContextDir, relDockerfile string, err error)
- func GetContextFromReader(r io.ReadCloser, dockerfileName string) (out io.ReadCloser, relDockerfile string, err error)
- func GetContextFromURL(out io.Writer, remoteURL, dockerfileName string) (io.ReadCloser, string, error)
- func ValidateContextDirectory(srcPath string, excludes []string) error
Constants ¶
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 ¶
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.