cmd/dist, remotes: break out docker resolver
Allow usage of the experimental docker resolver as a package. There are very few changes to the consuming code, demonstrating the effectiveness of the abstraction. This move will allow future contributions to a more featured resolver implementation. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
4cc7cddf4b
commit
e1a361bff2
5 changed files with 314 additions and 302 deletions
8
cmd/dist/common.go
vendored
8
cmd/dist/common.go
vendored
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
@ -8,6 +9,8 @@ import (
|
|||
"github.com/boltdb/bolt"
|
||||
"github.com/docker/containerd/content"
|
||||
"github.com/docker/containerd/images"
|
||||
"github.com/docker/containerd/remotes"
|
||||
"github.com/docker/containerd/remotes/docker"
|
||||
"github.com/urfave/cli"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
@ -57,3 +60,8 @@ func getDB(ctx *cli.Context, readonly bool) (*bolt.DB, error) {
|
|||
|
||||
return db, nil
|
||||
}
|
||||
|
||||
// getResolver prepares the resolver from the environment and options.
|
||||
func getResolver(ctx context.Context) (remotes.Resolver, error) {
|
||||
return docker.NewResolver(), nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue