build: replace uses of archive.CanonicalTarNameForPath
As it's just an alias for filepath.IsAbs. Also added a normalize step in TrimBuildFilesFromExcludes, so that callers are not _required_ to first normalize the path. We are considering deprecating and/or removing this function in the archive package, so removing it in the cli code helps transitioning if we decide to deprecate and/or remove it. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -32,6 +32,9 @@ func TrimBuildFilesFromExcludes(excludes []string, dockerfile string, dockerfile
|
||||
if keep, _ := fileutils.Matches(".dockerignore", excludes); keep {
|
||||
excludes = append(excludes, "!.dockerignore")
|
||||
}
|
||||
|
||||
// canonicalize dockerfile name to be platform-independent.
|
||||
dockerfile = filepath.ToSlash(dockerfile)
|
||||
if keep, _ := fileutils.Matches(dockerfile, excludes); keep && !dockerfileFromStdin {
|
||||
excludes = append(excludes, "!"+dockerfile)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user