소스 검색

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{}{}