Ver Fonte

Merge pull request #16660 from Microsoft/js/hostname

Windows: --hostname support
Brian Goff há 9 anos atrás
pai
commit
5ec323aaa2

+ 1 - 0
daemon/container_windows.go

@@ -140,6 +140,7 @@ func populateCommand(c *Container, env []string) error {
 		FirstStart:     !c.HasBeenStartedBefore,
 		FirstStart:     !c.HasBeenStartedBefore,
 		LayerFolder:    layerFolder,
 		LayerFolder:    layerFolder,
 		LayerPaths:     layerPaths,
 		LayerPaths:     layerPaths,
+		Hostname:       c.Config.Hostname,
 	}
 	}
 
 
 	return nil
 	return nil

+ 1 - 0
daemon/execdriver/driver.go

@@ -219,4 +219,5 @@ type Command struct {
 	FirstStart         bool              `json:"first_start"`
 	FirstStart         bool              `json:"first_start"`
 	LayerPaths         []string          `json:"layer_paths"` // Windows needs to know the layer paths and folder for a command
 	LayerPaths         []string          `json:"layer_paths"` // Windows needs to know the layer paths and folder for a command
 	LayerFolder        string            `json:"layer_folder"`
 	LayerFolder        string            `json:"layer_folder"`
+	Hostname           string            `json:"hostname"` // Windows sets the hostname in the execdriver
 }
 }

+ 2 - 0
daemon/execdriver/windows/run.go

@@ -71,6 +71,7 @@ type containerInit struct {
 	LayerFolderPath         string   // Where the layer folders are located
 	LayerFolderPath         string   // Where the layer folders are located
 	Layers                  []layer  // List of storage layers
 	Layers                  []layer  // List of storage layers
 	ProcessorWeight         int64    // CPU Shares 1..9 on Windows; or 0 is platform default.
 	ProcessorWeight         int64    // CPU Shares 1..9 on Windows; or 0 is platform default.
+	HostName                string   // Hostname
 }
 }
 
 
 // defaultOwner is a tag passed to HCS to allow it to differentiate between
 // defaultOwner is a tag passed to HCS to allow it to differentiate between
@@ -101,6 +102,7 @@ func (d *Driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, hooks execd
 		IgnoreFlushesDuringBoot: c.FirstStart,
 		IgnoreFlushesDuringBoot: c.FirstStart,
 		LayerFolderPath:         c.LayerFolder,
 		LayerFolderPath:         c.LayerFolder,
 		ProcessorWeight:         c.Resources.CPUShares,
 		ProcessorWeight:         c.Resources.CPUShares,
+		HostName:                c.Hostname,
 	}
 	}
 
 
 	for i := 0; i < len(c.LayerPaths); i++ {
 	for i := 0; i < len(c.LayerPaths); i++ {