{"id":"4a0a37c91c516636","repo":"docker/cli","slug":"hostip-is-not-supported","errorCode":null,"errorMessage":"hostip is not supported","messagePattern":"hostip is not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"opts/swarmopts/port.go","lineNumber":116,"sourceCode":"\t\t}\n\n\t\tif pConfig.TargetPort == 0 {\n\t\t\treturn fmt.Errorf(\"missing mandatory field '%s'\", portOptTargetPort)\n\t\t}\n\n\t\tp.ports = append(p.ports, pConfig)\n\t} else {\n\t\t// short syntax ([ip:]public:private[/proto])\n\t\t//\n\t\t// TODO(thaJeztah): we need an equivalent that handles the \"ip-address\" part without depending on the nat package.\n\t\tports, portBindingMap, err := nat.ParsePortSpecs([]string{value})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, portBindings := range portBindingMap {\n\t\t\tfor _, portBinding := range portBindings {\n\t\t\t\tif portBinding.HostIP != \"\" {\n\t\t\t\t\treturn errors.New(\"hostip is not supported\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar portConfigs []swarm.PortConfig\n\t\tfor port := range ports {\n\t\t\tportProto, err := network.ParsePort(string(port))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tportConfig, err := ConvertPortToPortConfig(portProto, portBindingMap)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tportConfigs = append(portConfigs, portConfig...)\n\t\t}\n\t\tp.ports = append(p.ports, portConfigs...)\n\t}","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/opts/swarmopts/port.go#L98-L134","documentation":"Error \"hostip is not supported\" thrown in docker/cli.","triggerScenarios":"Thrown at opts/swarmopts/port.go:116 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}