You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
skip.If(t, testEnv.DaemonInfo.OSType!="windows", "only Windows has sandbox size control")
528
+
ctx:=context.TODO()
529
+
defersetupTest(t)()
530
+
531
+
dockerfile:=`FROM busybox AS intermediate
532
+
WORKDIR C:\\stuff
533
+
# Create and delete a 21GB file
534
+
RUN fsutil file createnew C:\\stuff\\bigfile_0.txt 22548578304 && del bigfile_0.txt
535
+
# Create three 7GB files
536
+
RUN fsutil file createnew C:\\stuff\\bigfile_1.txt 7516192768
537
+
RUN fsutil file createnew C:\\stuff\\bigfile_2.txt 7516192768
538
+
RUN fsutil file createnew C:\\stuff\\bigfile_3.txt 7516192768
539
+
# Copy that 21GB of data out into a new target
540
+
FROM busybox
541
+
COPY --from=intermediate C:\\stuff C:\\stuff
542
+
`
543
+
544
+
buf:=bytes.NewBuffer(nil)
545
+
w:=tar.NewWriter(buf)
546
+
writeTarRecord(t, w, "Dockerfile", dockerfile)
547
+
err:=w.Close()
548
+
assert.NilError(t, err)
549
+
550
+
apiclient:=testEnv.APIClient()
551
+
resp, err:=apiclient.ImageBuild(ctx,
552
+
buf,
553
+
types.ImageBuildOptions{
554
+
Remove: true,
555
+
ForceRemove: true,
556
+
})
557
+
558
+
out:=bytes.NewBuffer(nil)
559
+
assert.NilError(t, err)
560
+
_, err=io.Copy(out, resp.Body)
561
+
resp.Body.Close()
562
+
assert.NilError(t, err)
563
+
// The test passes if either:
564
+
// - the image build succeeded; or
565
+
// - The "COPY --from=intermediate" step ran out of space during re-exec'd writing of the transport layer information to hcsshim's temp directory
566
+
// The latter case means we finished the COPY operation, so the sandbox must have been larger than 20GB, which was the test,
567
+
// and _then_ ran out of space on the host during `importLayer` in the WindowsFilter graph driver, while committing the layer.
568
+
// See https://github.com/moby/moby/pull/41636#issuecomment-723038517 for more details on the operations being done here.
569
+
// Specifically, this happens on the Docker Jenkins CI Windows-RS5 build nodes.
570
+
// The two parts of the acceptable-failure case are on different lines, so we need two regexp checks.
assert.Check(t, is.Regexp("Successfully built|re-exec error: exit status 1: output: write.*daemon\\\\\\\\tmp\\\\\\\\hcs.*bigfile_[1-3].txt: There is not enough space on the disk.", out.String()))
573
+
}
574
+
526
575
funcTestBuildWithEmptyDockerfile(t*testing.T) {
527
576
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.40"), "broken in earlier versions")
0 commit comments