Browse code

Merge pull request #16660 from Microsoft/js/hostname

Windows: --hostname support

Brian Goff authored on 2015/10/09 05:11:49
Showing 3 changed files
... ...
@@ -140,6 +140,7 @@ func populateCommand(c *Container, env []string) error {
140 140
 		FirstStart:     !c.HasBeenStartedBefore,
141 141
 		LayerFolder:    layerFolder,
142 142
 		LayerPaths:     layerPaths,
143
+		Hostname:       c.Config.Hostname,
143 144
 	}
144 145
 
145 146
 	return nil
... ...
@@ -219,4 +219,5 @@ type Command struct {
219 219
 	FirstStart         bool              `json:"first_start"`
220 220
 	LayerPaths         []string          `json:"layer_paths"` // Windows needs to know the layer paths and folder for a command
221 221
 	LayerFolder        string            `json:"layer_folder"`
222
+	Hostname           string            `json:"hostname"` // Windows sets the hostname in the execdriver
222 223
 }
... ...
@@ -71,6 +71,7 @@ type containerInit struct {
71 71
 	LayerFolderPath         string   // Where the layer folders are located
72 72
 	Layers                  []layer  // List of storage layers
73 73
 	ProcessorWeight         int64    // CPU Shares 1..9 on Windows; or 0 is platform default.
74
+	HostName                string   // Hostname
74 75
 }
75 76
 
76 77
 // 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
101 101
 		IgnoreFlushesDuringBoot: c.FirstStart,
102 102
 		LayerFolderPath:         c.LayerFolder,
103 103
 		ProcessorWeight:         c.Resources.CPUShares,
104
+		HostName:                c.Hostname,
104 105
 	}
105 106
 
106 107
 	for i := 0; i < len(c.LayerPaths); i++ {