Add support for registry authentication

Updates the docker resolver to support authenticating
with registries.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2017-04-28 15:58:00 -07:00
parent 427468c626
commit 9d3f452371
6 changed files with 580 additions and 71 deletions

5
cmd/dist/pull.go vendored
View File

@@ -35,7 +35,7 @@ command. As part of this process, we do the following:
2. Prepare the snapshot filesystem with the pulled resources.
3. Register metadata for the image.
`,
Flags: []cli.Flag{},
Flags: registryFlags,
Action: func(clicontext *cli.Context) error {
var (
ctx = background
@@ -52,7 +52,7 @@ command. As part of this process, we do the following:
return err
}
resolver, err := getResolver(ctx)
resolver, err := getResolver(ctx, clicontext)
if err != nil {
return err
}
@@ -75,6 +75,7 @@ command. As part of this process, we do the following:
ongoing.add(ref)
name, desc, fetcher, err := resolver.Resolve(ctx, ref)
if err != nil {
log.G(ctx).WithError(err).Error("failed to resolve")
return err
}
log.G(ctx).WithField("image", name).Debug("fetching")