Skip to content

Commit

Permalink
Only override service mac if set on the main network.
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Apolloner <[email protected]>
  • Loading branch information
apollo13 authored and ndeloof committed Jan 7, 2025
1 parent d474515 commit 2ebb475
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/compose/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ func (s *composeService) prepareContainerMACAddress(ctx context.Context, service
return "", fmt.Errorf("a MAC address is specified for multiple networks (%s), but this feature requires Docker Engine 1.44 or later (currently: %s)", strings.Join(withMacAddress, ", "), version)
}

if mainNw != nil {
if mainNw != nil && mainNw.MacAddress != "" {
macAddress = mainNw.MacAddress
}
}
Expand Down

0 comments on commit 2ebb475

Please sign in to comment.