Ver código fonte

Merge pull request #16562 from Microsoft/10662-fixhttppull

Windows: Fix ADD from URL in dockerfile
Antonio Murdaca 9 anos atrás
pai
commit
c300978370
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      daemon/daemon_windows.go

+ 4 - 0
daemon/daemon_windows.go

@@ -36,6 +36,10 @@ func checkKernel() error {
 // adaptContainerSettings is called during container creation to modify any
 // adaptContainerSettings is called during container creation to modify any
 // settings necessary in the HostConfig structure.
 // settings necessary in the HostConfig structure.
 func (daemon *Daemon) adaptContainerSettings(hostConfig *runconfig.HostConfig, adjustCPUShares bool) {
 func (daemon *Daemon) adaptContainerSettings(hostConfig *runconfig.HostConfig, adjustCPUShares bool) {
+	if hostConfig == nil {
+		return
+	}
+
 	if hostConfig.CPUShares < 0 {
 	if hostConfig.CPUShares < 0 {
 		logrus.Warnf("Changing requested CPUShares of %d to minimum allowed of %d", hostConfig.CPUShares, windowsMinCPUShares)
 		logrus.Warnf("Changing requested CPUShares of %d to minimum allowed of %d", hostConfig.CPUShares, windowsMinCPUShares)
 		hostConfig.CPUShares = windowsMinCPUShares
 		hostConfig.CPUShares = windowsMinCPUShares