We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2c617c commit a56df1eCopy full SHA for a56df1e
frontend/dockerfile/builder/build.go
@@ -759,12 +759,10 @@ func parseExtraHosts(v string) ([]llb.HostIP, error) {
759
return nil, err
760
}
761
for _, field := range fields {
762
- parts := strings.SplitN(field, "=", 2)
763
- if len(parts) != 2 {
+ key, val, ok := strings.Cut(strings.ToLower(field), "=")
+ if !ok {
764
return nil, errors.Errorf("invalid key-value pair %s", field)
765
766
- key := strings.ToLower(parts[0])
767
- val := strings.ToLower(parts[1])
768
ip := net.ParseIP(val)
769
if ip == nil {
770
return nil, errors.Errorf("failed to parse IP %s", val)
0 commit comments