mirror of https://github.com/portainer/portainer
fix(container-creation): fix unregistered ports bindings when creating a container (#138)
parent
06fbb5ba34
commit
29fa33fb2b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue