1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Windows: --hostname support

This passes through the container hostname to HCS, which in Windows Server
2016 TP4 will set the container's hostname in the registry before starting
it. This will be silently ignored by TP3.

Signed-off-by: John Starks <jostarks@microsoft.com>
This commit is contained in:
John Starks 2015-09-21 14:39:28 -07:00
parent 252af0ae2f
commit 7e8c92ad72
3 changed files with 4 additions and 0 deletions

View file

@ -130,6 +130,7 @@ func populateCommand(ctx context.Context, 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

View file

@ -220,4 +220,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
} }

View file

@ -72,6 +72,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
@ -102,6 +103,7 @@ func (d *Driver) Run(ctx context.Context, c *execdriver.Command, pipes *execdriv
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++ {