jenkinsci / mesos-plugin

Mesos Cloud Jenkins Plugin
https://plugins.jenkins.io/mesos/
Apache License 2.0
290 stars 165 forks source link

Ability to pull from private docker registry. #316

Closed nkhanal0 closed 4 years ago

nkhanal0 commented 6 years ago

Jenkins dind images seem to be pulled from the default docker hub. Is there a provision that can somehow pull from the private docker registry?

maselvaraj commented 6 years ago

Yes. In field "Docker Image" you can prefix your private docker repo like mydockerrepo.com/my_org/my_repo_name

nkhanal0 commented 6 years ago

@maselvaraj: Thanks for the reply. Where would it get the credentials for that particular repository from ? Will it leverage the ~/.docker/config.json? Or do we have to mount the credentials from some mount path such as /mnt/docker.tar.gz to all the hosts where the slave might launch?

maselvaraj commented 6 years ago

In our setup we inject contents of config.json as an env variable and in pre build step we write the contents of the env variable into ~/.docker/config.json. If your hosts have config.json, then you can mount it into the container as you said.

sbeaulie commented 5 years ago

We create a /etc/docker.tar.gz archive that contains the .docker directory on each mesos agent node as per the mesos docs: https://mesosphere.github.io/marathon/docs/native-docker-private-registry.html#registry--20---docker-16-and-up

Then use the jenkins mesos plugin's Additional URIs 'Add URI' setting configured with

URI: /etc/docker.tar.gz Extract the URI: checked

This will enable mesos to extract that file inside the workspace for the task, and pull the right docker image when running the container.

jeschkies commented 4 years ago

@nkhanal0, did it work for?

jeschkies commented 4 years ago

Closing for lack of response.