Sfoglia il codice sorgente

Merge pull request #24853 from Microsoft/jjh/nanoserver

Windows: Allow nanoserver image for CLI
Sebastiaan van Stijn 9 anni fa
parent
commit
4b7a83dbce
1 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. 8 2
      integration-cli/docker_test_vars.go

+ 8 - 2
integration-cli/docker_test_vars.go

@@ -61,12 +61,13 @@ var (
 	// driver of the daemon. This is initialized in docker_utils by sending
 	// a version call to the daemon and examining the response header.
 	daemonStorageDriver string
-)
 
-const (
 	// WindowsBaseImage is the name of the base image for Windows testing
+	// Environment variable WINDOWS_BASE_IMAGE can override this
 	WindowsBaseImage = "windowsservercore"
+)
 
+const (
 	// DefaultImage is the name of the base image for the majority of tests that
 	// are run across suites
 	DefaultImage = "busybox"
@@ -128,4 +129,9 @@ func init() {
 	}
 	volumesConfigPath = dockerBasePath + "/volumes"
 	containerStoragePath = dockerBasePath + "/containers"
+
+	if len(os.Getenv("WINDOWS_BASE_IMAGE")) > 0 {
+		WindowsBaseImage = os.Getenv("WINDOWS_BASE_IMAGE")
+		fmt.Println("INFO: Windows Base image is ", WindowsBaseImage)
+	}
 }