Closed nkhanal0 closed 4 years ago
Yes. In field "Docker Image" you can prefix your private docker repo like mydockerrepo.com/my_org/my_repo_name
@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?
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.
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.
@nkhanal0, did it work for?
Closing for lack of response.
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?