Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 6902f57

Browse files
authored
Merge pull request #1967 from ndeloof/expose_ports
include exposed ports in container ports config
2 parents 377493d + 94997be commit 6902f57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/compose/create.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,10 @@ func setBlkio(blkio *types.BlkioConfig, resources *container.Resources) {
527527

528528
func buildContainerPorts(s types.ServiceConfig) nat.PortSet {
529529
ports := nat.PortSet{}
530+
for _, s := range s.Expose {
531+
p := nat.Port(s)
532+
ports[p] = struct{}{}
533+
}
530534
for _, p := range s.Ports {
531535
p := nat.Port(fmt.Sprintf("%d/%s", p.Target, p.Protocol))
532536
ports[p] = struct{}{}

0 commit comments

Comments
 (0)