mirror of
https://github.com/docker/compose.git
synced 2025-07-27 07:34:10 +02:00
Merge pull request #1967 from ndeloof/expose_ports
include exposed ports in container ports config
This commit is contained in:
commit
6902f57d77
@ -527,6 +527,10 @@ func setBlkio(blkio *types.BlkioConfig, resources *container.Resources) {
|
|||||||
|
|
||||||
func buildContainerPorts(s types.ServiceConfig) nat.PortSet {
|
func buildContainerPorts(s types.ServiceConfig) nat.PortSet {
|
||||||
ports := nat.PortSet{}
|
ports := nat.PortSet{}
|
||||||
|
for _, s := range s.Expose {
|
||||||
|
p := nat.Port(s)
|
||||||
|
ports[p] = struct{}{}
|
||||||
|
}
|
||||||
for _, p := range s.Ports {
|
for _, p := range s.Ports {
|
||||||
p := nat.Port(fmt.Sprintf("%d/%s", p.Target, p.Protocol))
|
p := nat.Port(fmt.Sprintf("%d/%s", p.Target, p.Protocol))
|
||||||
ports[p] = struct{}{}
|
ports[p] = struct{}{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user