build

package
v23.0.7+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 22 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 AddDockerfileToBuildContext

func AddDockerfileToBuildContext(dockerfileCtx io.ReadCloser, buildCtx io.ReadCloser) (io.ReadCloser, string, error)

AddDockerfileToBuildContext from a ReadCloser, returns a new archive and the relative path to the dockerfile in the context.

func Compress

func Compress(buildCtx io.ReadCloser) (io.ReadCloser, error)

Compress the build context for sending to the API

func DetectArchiveReader

func DetectArchiveReader(input io.ReadCloser) (rc io.ReadCloser, isArchive bool, err error)

DetectArchiveReader detects whether the input stream is an archive or a Dockerfile and returns a buffered version of input, safe to consume in lieu of input. If an archive is detected, isArchive is set to true, and to false otherwise, in which case it is safe to assume input represents the contents of a Dockerfile.

func GetContextFromGitURL

func GetContextFromGitURL(gitURL, dockerfileName string) (