Browse code

Windows: Bump RW layer size

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2018/01/04 08:59:06
Showing 1 changed files
... ...
@@ -11,6 +11,7 @@ import (
11 11
 	"os"
12 12
 	"path"
13 13
 	"path/filepath"
14
+	"runtime"
14 15
 	"strconv"
15 16
 	"strings"
16 17
 
... ...
@@ -534,7 +535,7 @@ func hostConfigFromOptions(options *types.ImageBuildOptions) *container.HostConf
534 534
 		Ulimits:      options.Ulimits,
535 535
 	}
536 536
 
537
-	return &container.HostConfig{
537
+	hc := &container.HostConfig{
538 538
 		SecurityOpt: options.SecurityOpt,
539 539
 		Isolation:   options.Isolation,
540 540
 		ShmSize:     options.ShmSize,
... ...
@@ -544,6 +545,17 @@ func hostConfigFromOptions(options *types.ImageBuildOptions) *container.HostConf
544 544
 		LogConfig:  defaultLogConfig,
545 545
 		ExtraHosts: options.ExtraHosts,
546 546
 	}
547
+
548
+	// For WCOW, the default of 20GB hard-coded in the platform
549
+	// is too small for builder scenarios where many users are
550
+	// using RUN statements to install large amounts of data.
551
+	// Use 127GB as that's the default size of a VHD in Hyper-V.
552
+	if runtime.GOOS == "windows" && options.Platform == "windows" {
553
+		hc.StorageOpt = make(map[string]string)
554
+		hc.StorageOpt["size"] = "127GB"
555
+	}
556
+
557
+	return hc
547 558
 }
548 559
 
549 560
 // fromSlash works like filepath.FromSlash but with a given OS platform field