fix(container-creation): fix unregistered ports bindings when creating a container (#138)

pull/139/head
Anthony Lapenna 2016-08-17 19:03:36 +12:00 committed by GitHub
parent 06fbb5ba34
commit 29fa33fb2b
1 changed files with 2 additions and 0 deletions

View File

@ -17,6 +17,7 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, e
$scope.config = {
Env: [],
ExposedPorts: {},
HostConfig: {
RestartPolicy: {
Name: 'no'
@ -150,6 +151,7 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, e
if (portBinding.hostPort && portBinding.containerPort) {
var key = portBinding.containerPort + "/" + portBinding.protocol;
bindings[key] = [{ HostPort: portBinding.hostPort }];
config.ExposedPorts[key] = {};
}
});
config.HostConfig.PortBindings = bindings;