Skip to content

Commit

Permalink
build: replace uses of archive.CanonicalTarNameForPath
Browse files Browse the repository at this point in the history
This function is an alias for filepath.IsAbs and we are considering deprecating
and/or removing this function in the archive package, so removing its uses
helps transitioning if we decide to deprecate and/or remove it.

[docker/cli@fb0788f] also added a normalize step in TrimBuildFilesFromExcludes,
so that callers are not _required_ to first normalize the path, so the
normalizeation may be redunant, but keeping the normalization as this variable
is used further down the code.

[docker/cli@fb0788f]: docker/cli@fb0788f

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah authored and glours committed Jun 17, 2024
1 parent 1a14fcb commit 5ec37d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/compose/build_classic.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (s *composeService) doBuildClassic(ctx context.Context, project *types.Proj
}

// And canonicalize dockerfile name to a platform-independent one
relDockerfile = archive.CanonicalTarNameForPath(relDockerfile)
relDockerfile = filepath.ToSlash(relDockerfile)

excludes = build.TrimBuildFilesFromExcludes(excludes, relDockerfile, false)
buildCtx, err = archive.TarWithOptions(contextDir, &archive.TarOptions{
Expand Down

0 comments on commit 5ec37d0

Please sign in to comment.