From 5ec37d08a58c43cf22978402bbf20f830c3159bf Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 16 Jun 2024 15:11:10 +0200 Subject: [PATCH] build: replace uses of archive.CanonicalTarNameForPath 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]: https://github.com/docker/cli/commit/fb0788f18fcd90dbe95a7c7324d2c22e05050d71 Signed-off-by: Sebastiaan van Stijn --- pkg/compose/build_classic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/compose/build_classic.go b/pkg/compose/build_classic.go index 150383e65..9401d812a 100644 --- a/pkg/compose/build_classic.go +++ b/pkg/compose/build_classic.go @@ -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{