Skip to content

Commit 2d013b6

Browse files
authored
Merge pull request moby#5523 from profnandaa/tests-4485-revisit-frontend
tests: add `testDockerfileFromHTTP` for WCOW
2 parents edaa93d + ca6e771 commit 2d013b6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

client/llb/fileop.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
_ "crypto/sha256" // for opencontainers/go-digest
66
"os"
77
"path"
8+
"path/filepath"
89
"strconv"
910
"strings"
1011
"time"
@@ -563,7 +564,7 @@ func (a *fileActionCopy) toProtoAction(ctx context.Context, parent string, base
563564
}
564565

565566
func (a *fileActionCopy) sourcePath(ctx context.Context) (string, error) {
566-
p := path.Clean(a.src)
567+
p := filepath.ToSlash(path.Clean(a.src))
567568
dir := "/"
568569
var err error
569570
if !path.IsAbs(p) {

frontend/dockerfile/dockerfile_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4491,7 +4491,6 @@ COPY --from=build foo bar2
44914491
}
44924492

44934493
func testDockerfileFromHTTP(t *testing.T, sb integration.Sandbox) {
4494-
integration.SkipOnPlatform(t, "windows")
44954494
f := getFrontend(t, sb)
44964495

44974496
buf := bytes.NewBuffer(nil)
@@ -4509,9 +4508,10 @@ func testDockerfileFromHTTP(t *testing.T, sb integration.Sandbox) {
45094508
require.NoError(t, err)
45104509
}
45114510

4512-
writeFile("mydockerfile", `FROM scratch
4511+
dockerfile := fmt.Sprintf(`FROM %s
45134512
COPY foo bar
4514-
`)
4513+
`, integration.UnixOrWindows("scratch", "nanoserver"))
4514+
writeFile("mydockerfile", dockerfile)
45154515

45164516
writeFile("foo", "foo-contents")
45174517

0 commit comments

Comments
 (0)