Skip to content

Commit

Permalink
add missing expose port config
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Sep 13, 2018
1 parent 27ae597 commit 8386e35
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cluster/calcium/create_container.go
Expand Up @@ -335,15 +335,18 @@ func (c *Calcium) makeContainerOptions(index int, quota types.CPUMap, opts *type
// Bridge 下 publish 出 Port
if engineNetworkMode.IsBridge() {
portMapping := nat.PortMap{}
exposePorts := nat.PortSet{}
for _, p := range opts.Entrypoint.Publish {
port, err := nat.NewPort("tcp", p)
if err != nil {
return nil, nil, nil, "", err
}
exposePorts[port] = struct{}{}
portMapping[port] = []nat.PortBinding{}
portMapping[port] = append(portMapping[port], nat.PortBinding{HostPort: p})
}
hostConfig.PortBindings = portMapping
config.ExposedPorts = exposePorts
}

return config, hostConfig, networkConfig, containerName, nil
Expand Down

0 comments on commit 8386e35

Please sign in to comment.