Skip to content

Commit fdc8c33

Browse files
authored
Merge pull request #4 from docker/fix-dockerio-handling
Fix client behavior so that if docker.io is the host (not a real registry) we substitute it with the real registry (registry-1.docker.io)
2 parents 59e2a4d + 448f98a commit fdc8c33

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

ociclient/client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ func New(host string, opts0 *Options) (oci.Interface, error) {
8888
if opts.UserAgent == "" {
8989
opts.UserAgent = "docker/oci"
9090
}
91+
if host == "docker.io" {
92+
host = "registry-1.docker.io"
93+
}
9194
// Check that it's a valid host by forming a URL from it and checking that it matches.
9295
u, err := url.Parse("https://" + host + "/path")
9396
if err != nil {

0 commit comments

Comments
 (0)