--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8d8d6fd2-11c2-4946-93b3-07981944af23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mounting the key location as volume with `docker run -v /path/to/keys:/var/jenkins_home/.ssh` does not work, as the mount point in the container inherits the uid/gid of the host directory, which does not match the uid/gid of the "jenkins" user within the container.
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer John Marshall Doolittle, Gordon Davies, Roger Illing, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.
Well, then let it match. Or do you need it on the host?
HTH...
Dirk
ENTRYPOINT usermod -u $(stat -c "%u" /var/jenkins_home) jenkins && \+ gosu jenkins /bin/tini -- /usr/local/bin/jenkins.shone I think would be nice is one that basically takes an SSH_AGENT from the Jenkins user and exposes its keys as SSH keys (so good an idea I may implement it myself... if I get spare time or if my employer agrees it is a good idea)
2. Seed the JENKINS_HOME volume with unencrypted credentials.xml and have an init.groovy.d script trigger a save (which will encrypt them on first start)
Thanks for the response, but I think I must be missing a trick because I don't know what you're getting at.
If say, the uid of the host user is 1005, and the uid of the container's jenkins user is 1000, these clearly don't match. I would need to set the uid of the user in the container to 1005 in order to let it use the mounted keys,
FROM jenkins:2.19.4
ARG user=jenkinsARG group=jenkinsARG olduid=1000ARG oldgid=1000ARG uidARG gidENV JENKINS_HOME /var/lib/jenkinsENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log
USER rootRUN usermod -u $uid $userRUN usermod -d /var/lib/jenkins $userRUN groupmod -g $gid $groupRUN usermod -g $gid $groupRUN find / -path /proc -prune -o -group $oldgid -print | xargs chgrp -hv $groupRUN find / -path /proc -prune -o -user $olduid -print | xargs chown -hv $userRUN cp -R /var/jenkins_home /var/lib/jenkinsRUN chown -R $user:$group /var/lib/jenkinsVOLUME /var/lib/jenkinsUSER $user