moby / tool

Temporary repository for the moby assembly tool used by the Moby project
Apache License 2.0
75 stars 65 forks source link

Enable 'moby build' for private repos #202

Closed rn closed 6 years ago

rn commented 6 years ago

Currently moby build fails with:

FATA[0008] Failed to build init tarball from foo/bar:123: Could not pull image foo/bar:123: Error response from daemon: pull access denied for foo/bar, repository does not exist or may require 'docker login'

where foo/bar is a private repo on hub and I can docker pull is manually.

Looks like the moby build is not using authentication.

djs55 commented 6 years ago

Also reported as #104

rn commented 6 years ago

I had a quick look at this, and it seems that we'd need to vendor in github.com/docker/cli and then: 1) use something like GetDefaultAuthConfig() for each registry we might pull from. This will look up credentials from the credidentials store (or config.json 2) call client.RegistryLogin() in the code in dockerClient() or elsewhere.