{"id":"5c76e40a7a68e0b1","repo":"docker/cli","slug":"insecure-registry-s-should-not-contain","errorCode":null,"errorMessage":"insecure registry %s should not contain '://'","messagePattern":"insecure registry (.+?) should not contain '://'","errorType":"validation","errorClass":"invalidParameterErr","httpStatus":null,"severity":"error","filePath":"internal/registry/config.go","lineNumber":121,"sourceCode":"\t// Localhost is by default considered as an insecure registry. This is a\n\t// stop-gap for people who are running a private registry on localhost.\n\tregistries = append(registries, \"::1/128\", \"127.0.0.0/8\")\n\n\tvar (\n\t\tinsecureRegistryCIDRs = make([]*net.IPNet, 0)\n\t\tindexConfigs          = make(map[string]*registry.IndexInfo)\n\t)\n\nskip:\n\tfor _, r := range registries {\n\t\tif scheme, host, ok := strings.Cut(r, \"://\"); ok {\n\t\t\tswitch strings.ToLower(scheme) {\n\t\t\tcase \"http\", \"https\":\n\t\t\t\tlog.G(context.TODO()).Warnf(\"insecure registry %[1]s should not contain '%[2]s' and '%[2]ss' has been removed from the insecure registry config\", r, scheme)\n\t\t\t\tr = host\n\t\t\tdefault:\n\t\t\t\t// unsupported scheme\n\t\t\t\treturn nil, invalidParam(fmt.Errorf(\"insecure registry %s should not contain '://'\", r))\n\t\t\t}\n\t\t}\n\t\t// Check if CIDR was passed to --insecure-registry\n\t\t_, ipnet, err := net.ParseCIDR(r)\n\t\tif err == nil {\n\t\t\t// Valid CIDR. If ipnet is already in config.InsecureRegistryCIDRs, skip.\n\t\t\tfor _, value := range insecureRegistryCIDRs {\n\t\t\t\tif value.IP.String() == ipnet.IP.String() && value.Mask.String() == ipnet.Mask.String() {\n\t\t\t\t\tcontinue skip\n\t\t\t\t}\n\t\t\t}\n\t\t\t// ipnet is not found, add it in config.InsecureRegistryCIDRs\n\t\t\tinsecureRegistryCIDRs = append(insecureRegistryCIDRs, ipnet)\n\t\t} else {\n\t\t\tif err := validateHostPort(r); err != nil {\n\t\t\t\treturn nil, invalidParam(fmt.Errorf(\"insecure registry %s is not valid: %w\", r, err))\n\t\t\t}\n\t\t\t// Assume `host:port` if not CIDR.","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/internal/registry/config.go#L103-L139","documentation":"Error \"insecure registry %s should not contain '://'\" thrown in docker/cli.","triggerScenarios":"Thrown at internal/registry/config.go:121 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}