Просмотр исходного кода

Only override service mac if set on the main network.

Signed-off-by: Florian Apolloner <[email protected]>
Florian Apolloner 1 год назад
Родитель
Сommit
2ebb475433
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      pkg/compose/create.go

+ 1 - 1
pkg/compose/create.go

@@ -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
 		}
 	}