mirror of
https://github.com/portainer/portainer.git
synced 2025-07-20 05:49:40 +02:00
fix(container-creation): fix unregistered ports bindings when creating a container (#138)
This commit is contained in:
parent
06fbb5ba34
commit
29fa33fb2b
1 changed files with 2 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue