diff --git a/app/components/createContainer/createContainerController.js b/app/components/createContainer/createContainerController.js index 70ef048aa..623da4eb8 100644 --- a/app/components/createContainer/createContainerController.js +++ b/app/components/createContainer/createContainerController.js @@ -150,7 +150,15 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, e config.HostConfig.PortBindings.forEach(function (portBinding) { if (portBinding.hostPort && portBinding.containerPort) { var key = portBinding.containerPort + "/" + portBinding.protocol; - bindings[key] = [{ HostPort: portBinding.hostPort }]; + var binding = {}; + if (portBinding.hostPort.indexOf(':') > -1) { + var hostAndPort = portBinding.hostPort.split(':'); + binding.HostIp = hostAndPort[0]; + binding.HostPort = hostAndPort[1]; + } else { + binding.HostPort = portBinding.hostPort; + } + bindings[key] = [binding]; config.ExposedPorts[key] = {}; } });