func DefaultHost(ns string) (string, error) {
	if ns == "docker.io" {
		return "registry-1.docker.io", nil
	}
	return ns, nil
}
DefaultHost is the default host function.
package docker
import (
	"context"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	"path"
	"strings"
	"github.com/containerd/containerd/errdefs"
	"github.com/containerd/containerd/images"
	"github.com/containerd/containerd/log"
	"github.com/containerd/containerd/reference"
	"github.com/containerd/containerd/remotes"
	"github.com/containerd/containerd/remotes/docker/schema1"
	"github.com/containerd/containerd/version"
	digest "github.com/opencontainers/go-digest"
	ocispec "github.com/opencontainers/image-spec/specs-go/v1"
	"github.com/pkg/errors"
	"github.com/sirupsen/logrus"
	"golang.org/x/net/context/ctxhttp"
)
var (
	ErrInvalidAuthorization = errors.New("authorization failed")
	MaxManifestSize int64 = 4 * 1048 * 1048
)
type Authorizer interface {
	Authorize(context.Context, *http.Request) error
	AddResponses(context.Context, []*http.Response) error
}
type ResolverOptions struct {
	Hosts RegistryHosts
	Headers http.Header
	Tracker StatusTracker
	Authorizer Authorizer
	Credentials func(string) (string, string, error)
	Host func(string) (string, error)
	PlainHTTP bool
	Client *http.Client
}