Skip to content

Commit

Permalink
add port bindings support
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
  • Loading branch information
glours committed Oct 16, 2024
1 parent 9e97da5 commit dfdc8c1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,17 @@ func (s *composeService) extractComposeConfiguration(service *types.ServiceConfi
service.Networks = networkConfigs
maps.Copy(networks, detectedNetworks)
}
if len(inspect.HostConfig.PortBindings) > 0 {
for key, portBindings := range inspect.HostConfig.PortBindings {
for _, portBinding := range portBindings {
service.Ports = append(service.Ports, types.ServicePortConfig{
Target: uint32(key.Int()),
Published: portBinding.HostPort,
Protocol: key.Proto(),
})
}
}
}
}

func increment(scale *int) *int {
Expand Down

0 comments on commit dfdc8c1

Please sign in to comment.