Skip to content

Commit

Permalink
Support ollama.ai
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming committed Apr 1, 2024
1 parent cdf47f4 commit a89c2cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/crproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,16 @@ func main() {
crproxy.WithMaxClientSizeForEachRegistry(16),
crproxy.WithDomainAlias(map[string]string{
"docker.io": "registry-1.docker.io",
"ollama.ai": "registry.ollama.ai",
}),
crproxy.WithPathInfoModifyFunc(func(info *crproxy.PathInfo) *crproxy.PathInfo {
// docker.io/busybox => docker.io/library/busybox
if info.Host == "registry-1.docker.io" && !strings.Contains(info.Image, "/") {
info.Image = "library/" + info.Image
}
if info.Host == "registry.ollama.ai" && !strings.Contains(info.Image, "/") {
info.Image = "library/" + info.Image
}
return info
}),
crproxy.WithDisableKeepAlives(disableKeepAlives),
Expand Down

0 comments on commit a89c2cb

Please sign in to comment.