Skip to content
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

How to pull docker image from private registry using singularity custom executor? #1098

Closed
jaredstehler opened this issue Jun 18, 2016 · 2 comments

Comments

@jaredstehler
Copy link
Contributor

I'm not sure how to get the singularity executor to use credentials to pull from my private docker registry? I've authenticated successfully in docker on each of my slaves (which put the /root/.docker/config.json in each one with the auth token) but still see "Not authorized" exceptions on startup in the task log:

Caused by: com.spotify.docker.client.ImagePullFailedException: Image pull failed: maven.intellify.tools:9453/docker-intellify/pdf-service: ProgressMessage{id=null, status=null, stream=null, error=unauthorized: authentication required, progress=null, progressDetail=null}
    at com.spotify.docker.client.LoggingPullHandler.progress(LoggingPullHandler.java:41) ~[SingularityExecutor-0.7.1-shaded.jar:0.7.1]
    at com.spotify.docker.client.ProgressStream.tail(ProgressStream.java:74) ~[SingularityExecutor-0.7.1-shaded.jar:0.7.1]
    at com.spotify.docker.client.DefaultDockerClient.pull(DefaultDockerClient.java:668) ~[SingularityExecutor-0.7.1-shaded.jar:0.7.1]
    at com.spotify.docker.client.DefaultDockerClient.pull(DefaultDockerClient.java:650) ~[SingularityExecutor-0.7.1-shaded.jar:0.7.1]
    at com.hubspot.singularity.executor.utils.DockerUtils$2.call(DockerUtils.java:53) ~[SingularityExecutor-0.7.1-shaded.jar:0.7.1]
    at com.hubspot.singularity.executor.utils.DockerUtils$2.call(DockerUtils.java:51) ~[SingularityExecutor-0.7.1-shaded.jar:0.7.1]

I see that the spotify docker client says to specify credentials in an AuthConfig instance, but I don't see that anywhere in the SingularityExecutor source, so is there something simple I'm missing?

from https://github.com/spotify/docker-client :

// Pull an image from a private repository
// Server address defaults to "https://index.docker.io/v1/"
AuthConfig authConfig = AuthConfig.builder().email("foo@bar.com").username("foobar")
  .password("secret-password").serverAddress("https://myprivateregistry.com/v1/").build();
docker.pull("foobar/busybox-private:latest", authConfig);
@ssalinas
Copy link
Member

Yeah, that's some config we still need to add. The configuration for the custom executor docker stuff is still pretty basic right now. We can add that in (or feel free to PR it!)

@jaredstehler
Copy link
Contributor Author

Thanks for the heads up! I'll try my hand at a PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants