Преглед на файлове

include exposed ports in container ports config

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof преди 4 години
родител
ревизия
94997be633
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      pkg/compose/create.go

+ 4 - 0
pkg/compose/create.go

@@ -527,6 +527,10 @@ func setBlkio(blkio *types.BlkioConfig, resources *container.Resources) {
 
 func buildContainerPorts(s types.ServiceConfig) nat.PortSet {
 	ports := nat.PortSet{}
+	for _, s := range s.Expose {
+		p := nat.Port(s)
+		ports[p] = struct{}{}
+	}
 	for _, p := range s.Ports {
 		p := nat.Port(fmt.Sprintf("%d/%s", p.Target, p.Protocol))
 		ports[p] = struct{}{}