-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nomad cluster is unable to pull docker images from private registry #236
Comments
That @Zortaniac, this is going to be an issue with the pull-through cache; in the past, the way I have dealt with this is to use the
Then, use the image on nomad without any authentication.
That said, this is not a fix but a workaround; I am looking at this now to see if I can fix this so that authenticated images can be pulled through the cache. It should be possible. |
Thanks @nicholasjackson. I will use the workaround for now. I'm not that familiar with the docker image cache, but if I understood it right, the cache needs to be able to authenticate against the private registry. |
@Zortaniac I have been looking into this, the pull through cache should just pass the auth through, I wonder if I am missing a setting. A registry stanza is a great idea, the pull through cache is great for saving bandwidth and stopping pull limits on Docker Hub. |
As said I haven't used the docker cache yet, but as far as I understand the documentation it does not pass through private repositories due to security issues. It might allow access to private images by accident, if the cache is publicly available. I will have a look if I get this implemented in the coming days. |
Ah we don’t use that one, we use this Nginx config that was written by a Googler for an example for Cloud Run. |
Thanks for the heads-up. It seems the same applies for that one as well. At least the there is some configuration to authenticate against private repositories. |
@nicholasjackson, short update on this topic. I actually extended the image cache resource with some options to specify repositories, but it turned out to not be the problem. I noticed that our repository isn't actually private (that is fine btw), but the current proxy settings interfere with the image download in a way that it causes authentication issues. I basically 'solved' it by removing the Since the docker daemon is started by supervisord I assume passing the option isn't really possible? The daemon.json would need to be altered dynamically. Is there already a place in the code where something similar is done, to get an idea how it could be easily solved? I also noticed some other problems, some I was already able to fix and will send a PR when I'm done:
|
Registry mirrors, sadly, would not solve the problem as you would still need to store the authentication credentials in the mirror. It might be a better option than using the HTTP proxy. The current solution, where |
Sry, if I didn't make it clear. I already extended the stanza to allow for repository configuration. It gets passed to the right environment variables within the image proxy as described in the README and looks like this:
That's how I noticed that the authentication doesn't seem to be the problem but the proxy configuration on the nomad container itself. |
@nicholasjackson, I opened the PR #244 that adds support for specifying (private) registries. I tested it with gitlab.com, others might require some additional work. |
Describe the bug
I'm unable to get nomad/docker to pull images from a private registry. As far as I can see, the problem seems to be related to the image cache.
First I added an auth config to the nomad configuration. But I noticed that it didn't work for nomad as well as docker itself on the running container.
What I then tried was to add the private registry to
noProxy
in thedaemon.json
, but that causes docker to crash during startup. Probably a better way would be to make it possible to let the image proxy to authenticate against the private registry.To Reproduce
Expected behavior
It should be possible to allow nomad/docker to pull an image from a private registry.
The text was updated successfully, but these errors were encountered: