docker: support group allocated ports and host_networks (#8623)

* docker: support group allocated ports

* docker: add new ports driver config to specify which group ports are mapped

* docker: update port mapping docs
This commit is contained in:
Nick Ethier
2020-08-11 18:30:22 -04:00
committed by GitHub
parent 8272654dab
commit c11dbcd001
11 changed files with 534 additions and 316 deletions

View File

@@ -936,6 +936,7 @@ func (tr *TaskRunner) buildTaskConfig() *drivers.TaskConfig {
alloc := tr.Alloc()
invocationid := uuid.Generate()[:8]
taskResources := tr.taskResources
ports := tr.Alloc().AllocatedResources.Shared.Ports
env := tr.envBuilder.Build()
tr.networkIsolationLock.Lock()
defer tr.networkIsolationLock.Unlock()
@@ -964,6 +965,7 @@ func (tr *TaskRunner) buildTaskConfig() *drivers.TaskConfig {
CPUShares: taskResources.Cpu.CpuShares,
PercentTicks: float64(taskResources.Cpu.CpuShares) / float64(tr.clientConfig.Node.NodeResources.Cpu.CpuShares),
},
Ports: &ports,
},
Devices: tr.hookResources.getDevices(),
Mounts: tr.hookResources.getMounts(),