Documentation ¶
Index ¶
- func AddPathToVolumeWhitelist(path string) error
- func AddToTar(p string, i os.FileInfo, hardlinks map[uint64]string, w *tar.Writer) error
- func ChildDirInWhitelist(path, directory string) bool
- func ContainsWildcards(paths []string) bool
- func CopyDir(src, dest string) error
- func CopyFile(src, dest string) error
- func CopySymlink(src, dest string) error
- func CreateFile(path string, reader io.Reader, perm os.FileMode, uid uint32, gid uint32) error
- func DeleteFilesystem() error
- func DestinationFilepath(src, dest, cwd string) (string, error)
- func DownloadFileToDest(rawurl, dest string) error
- func FilepathExists(path string) bool
- func Files(root string) ([]string, error)
- func GetBucketAndItem(context string) (string, string)
- func GetFSFromImage(img v1.Image) error
- func GetUserFromUsername(userStr string, groupStr string) (string, string, error)
- func HasFilepathPrefix(path, prefix string) bool
- func Hasher() func(string) (string, error)
- func IsDestDir(path string) bool
- func IsFileLocalTarArchive(src string) bool
- func IsSrcRemoteFileURL(rawurl string) bool
- func IsSrcsValid(srcsAndDest instructions.SourcesAndDest, resolvedSources []string, root string) error
- func MoveVolumeWhitelistToWhitelist() error
- func MtimeHasher() func(string) (string, error)
- func ParentDirectories(path string) []string
- func PathInWhitelist(path, directory string) bool
- func RelativeFiles(fp string, root string) ([]string, error)
- func ResolveEnvironmentReplacement(value string, envs []string, isFilepath bool) (string, error)
- func ResolveEnvironmentReplacementList(values, envs []string, isFilepath bool) ([]string, error)
- func ResolveSources(srcsAndDest instructions.SourcesAndDest, root string) ([]string, error)
- func SetLogLevel(logLevel string) error
- func URLDestinationFilepath(rawurl, dest, cwd string) string
- func UnpackCompressedTar(path, dir string) error
- func UnpackLocalTarArchive(path, dest string) error
- func UpdateConfigEnv(newEnvs []instructions.KeyValuePair, config *v1.Config, ...) error
- func Whiteout(p string, w *tar.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPathToVolumeWhitelist ¶
AddPathToVolumeWhitelist adds the given path to the volume whitelist It will get snapshotted when the VOLUME command is run then ignored for subsequent commands.
func ChildDirInWhitelist ¶
ChildDirInWhitelist returns true if there is a child file or directory of the path in the whitelist
func ContainsWildcards ¶
ContainsWildcards returns true if any entry in paths contains wildcards
func CopySymlink ¶
CopySymlink copies the symlink at src to dest
func CreateFile ¶
CreateFile creates a file at path and copies over contents from the reader
func DeleteFilesystem ¶
func DeleteFilesystem() error
DeleteFilesystem deletes the extracted image file system
func DestinationFilepath ¶
DestinationFilepath returns the destination filepath from the build context to the image filesystem If source is a file:
If dest is a dir, copy it to /dest/relpath If dest is a file, copy directly to dest
If source is a dir:
Assume dest is also a dir, and copy to dest/relpath
If dest is not an absolute filepath, add /cwd to the beginning
func DownloadFileToDest ¶
DownloadFileToDest downloads the file at rawurl to the given dest for the ADD command From add command docs:
- If <src> is a remote file URL: - destination will have permissions of 0600 - If remote file has HTTP Last-Modified header, we set the mtime of the file to that timestamp
func FilepathExists ¶
FilepathExists returns true if the path exists
func GetBucketAndItem ¶ added in v0.2.0
func GetFSFromImage ¶
func GetUserFromUsername ¶ added in v0.2.0
func HasFilepathPrefix ¶
HasFilepathPrefix checks if the given file path begins with prefix
func Hasher ¶
Hasher returns a hash function, used in snapshotting to determine if a file has changed
func IsFileLocalTarArchive ¶
IsFileLocalTarArchive returns true if the file is a local tar archive
func IsSrcRemoteFileURL ¶
func IsSrcsValid ¶
func IsSrcsValid(srcsAndDest instructions.SourcesAndDest, resolvedSources []string, root string) error
func MoveVolumeWhitelistToWhitelist ¶
func MoveVolumeWhitelistToWhitelist() error
MoveVolumeWhitelistToWhitelist copies over all directories that were volume mounted in this step to be whitelisted for all subsequent docker commands.
func MtimeHasher ¶
MtimeHasher returns a hash function, which only looks at mtime to determine if a file has changed
func ParentDirectories ¶
ParentDirectories returns a list of paths to all parent directories Ex. /some/temp/dir -> [/, /some, /some/temp, /some/temp/dir]
func PathInWhitelist ¶
func RelativeFiles ¶
RelativeFiles returns a list of all files at the filepath relative to root
func ResolveEnvironmentReplacement ¶
ResolveEnvironmentReplacement resolves replacing env variables in some text from envs It takes in a string representation of the command, the value to be resolved, and a list of envs (config.Env) Ex: fp = $foo/newdir, envs = [foo=/foodir], then this should return /foodir/newdir The dockerfile/shell package handles processing env values It handles escape characters and supports expansion from the config.Env array Shlex handles some of the following use cases (these and more are tested in integration tests) ""a'b'c"" -> "a'b'c" "Rex\ The\ Dog \" -> "Rex The Dog" "a\"b" -> "a"b"
func ResolveEnvironmentReplacementList ¶
ResolveEnvironmentReplacementList resolves a list of values by calling resolveEnvironmentReplacement
func ResolveSources ¶
func ResolveSources(srcsAndDest instructions.SourcesAndDest, root string) ([]string, error)
ResolveSources resolves the given sources if the sources contains wildcards It returns a list of resolved sources
func SetLogLevel ¶
SetLogLevel sets the logrus logging level
func URLDestinationFilepath ¶
URLDestinationFilepath gives the destination a file from a remote URL should be saved to
func UnpackCompressedTar ¶
UnpackCompressedTar unpacks the compressed tar at path to dir
func UnpackLocalTarArchive ¶
UnpackLocalTarArchive unpacks the tar archive at path to the directory dest Returns true if the path was actually unpacked
func UpdateConfigEnv ¶
func UpdateConfigEnv(newEnvs []instructions.KeyValuePair, config *v1.Config, replacementEnvs []string) error
Types ¶
This section is empty.