Skip to content

Commit 2ebb475

Browse files
apollo13ndeloof
authored andcommitted
Only override service mac if set on the main network.
Signed-off-by: Florian Apolloner <[email protected]>
1 parent d474515 commit 2ebb475

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/compose/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ func (s *composeService) prepareContainerMACAddress(ctx context.Context, service
416416
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)
417417
}
418418

419-
if mainNw != nil {
419+
if mainNw != nil && mainNw.MacAddress != "" {
420420
macAddress = mainNw.MacAddress
421421
}
422422
}

0 commit comments

Comments
 (0)