[JIRA] (JENKINS-50236) Add documentation on how to pass through docker configuration

1 view
Skip to first unread message

obsecurus@gmail.com (JIRA)

unread,
Mar 17, 2018, 11:50:02 AM3/17/18
to jenkinsc...@googlegroups.com
Matt L created an issue
 
Jenkins / Improvement JENKINS-50236
Add documentation on how to pass through docker configuration
Issue Type: Improvement Improvement
Assignee: Carlos Sanchez
Components: kubernetes-plugin
Created: 2018-03-17 15:49
Priority: Minor Minor
Reporter: Matt L

I was using secretEnv previously to pass in credentials for my docker repository as environment vars from a K8S secret in a scripted syntax job. This was working before the most recent plugin update and I just used the ENV in a docker login script. Originally I wanted to use the image-pull-secret to just mount a config.json file at /root/.docker/config.json but that also didn't work as I think the plugin doesn't know how to mount a kubernetes.io/dockerconfigjson type. My final attempt was to pass the host volume at /root/.docker into the guest which also didn't work. I imagine others will want to pass the host docker config in since they are already using the docker.sock socket. 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

obsecurus@gmail.com (JIRA)

unread,
Mar 17, 2018, 11:51:02 AM3/17/18
to jenkinsc...@googlegroups.com
Matt L updated an issue
Change By: Matt L
I was using secretEnv previously to pass in credentials for my docker repository as environment vars from a K8S secret in a scripted syntax job. This was working before the most recent plugin update and I just used the ENV in a docker login script. Originally I wanted to use the image-pull-secret to just mount a config.json file at /root/.docker/config.json but that also didn't work as I think the plugin doesn't know how to mount a kubernetes.io/dockerconfigjson type. My final attempt was to pass the host volume at /root/.docker into the guest which also didn't work. I imagine others will want to pass the host docker config in since they are already using the docker.sock socket. 

{code:java}
hostPathVolume(hostPath: '/root/.docker', mountPath: '/root/.docker'){code}

obsecurus@gmail.com (JIRA)

unread,
Mar 17, 2018, 11:58:02 AM3/17/18
to jenkinsc...@googlegroups.com
Matt L commented on Improvement JENKINS-50236
 
Re: Add documentation on how to pass through docker configuration

Looks like I misunderstood where the image-pull-secret is being stored. It appears my K8S workers do not have a /root/.docker/config.json file so it makes sense the mount doesn't work. I think it would still be good to document the recommended process for passing in docker login credentials. 

jenkins-ci@carlossanchez.eu (JIRA)

unread,
May 25, 2018, 4:36:01 AM5/25/18
to jenkinsc...@googlegroups.com

There is an example using docker registry secrets with kaniko
https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/kaniko.groovy

if you want to open a PR on how to improve the docs...

jglick@cloudbees.com (JIRA)

unread,
Jul 16, 2019, 3:44:13 PM7/16/19
to jenkinsc...@googlegroups.com
Jesse Glick assigned an issue to Unassigned
 
Change By: Jesse Glick
Assignee: Carlos Sanchez
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages