diff --git a/pkg/compose/create.go b/pkg/compose/create.go index ce6a01976..4c85bb447 100644 --- a/pkg/compose/create.go +++ b/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{}{}