Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50236

Add documentation on how to pass through docker configuration

      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. 

      hostPathVolume(hostPath: '/root/.docker', mountPath: '/root/.docker')

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

          Matt L added a comment -

          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. 

          Matt L added a comment - 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. 

          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...

          Carlos Sanchez added a comment - 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...

            Unassigned Unassigned
            obsecurus Matt L
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: