diff --git a/client/llb/fileop.go b/client/llb/fileop.go index 831c4f381edd..b57b8463d89f 100644 --- a/client/llb/fileop.go +++ b/client/llb/fileop.go @@ -5,6 +5,7 @@ import ( _ "crypto/sha256" // for opencontainers/go-digest "os" "path" + "path/filepath" "strconv" "strings" "time" @@ -801,6 +802,8 @@ func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, [] func normalizePath(parent, p string, keepSlash bool) string { origPath := p + // first, normalize everything to unix path + p = filepath.ToSlash(p) p = path.Clean(p) if !path.IsAbs(p) { p = path.Join("/", parent, p) diff --git a/solver/llbsolver/file/backend.go b/solver/llbsolver/file/backend.go index 293caa1082bd..58b489cb8a28 100644 --- a/solver/llbsolver/file/backend.go +++ b/solver/llbsolver/file/backend.go @@ -139,7 +139,7 @@ func docopy(ctx context.Context, src, dest string, action pb.FileActionCopy, u * } destPath, err := cleanPath(action.Dest) if err != nil { - return errors.Wrap(err, "cleaning path") + return errors.Wrap(err, "cleaning destination path") } if !action.CreateDestPath { p, err := fs.RootPath(dest, filepath.Join("/", action.Dest))