-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a convenient way of adding a custom root certificate authority cert #1605
Comments
Hi @Rolf-MP , you should be able to do so by mounting the certificate in the container, or by building your custom image instead: is there anything blocking you in this area? |
Hello Damien - thanks for your reply! I do not have the steps handy but do remember that the ca-cert needs to be available for Tomcat/Jetty somehow if we want Jenkins to trust certificates issued by our company certificate authority. The title therefore says "convenient". Maybe I overlooked something - very well possible .. |
Might be possible by changing our entrypoint to call this: |
Unfortunatley the example does not appear to work. In my personal instance I've tried using However, most examples (importing ca root cert to jvm, guide on java keytool) I've seen online discuss adding the certificate to a location which doesn't appear to exist in the container, the jre security cacerts directory. FROM jenkins/jenkins
USER root
RUN apt-get update && apt-get install -y \
lsb-release \
ca-certificates \
curl
RUN curl -fsSLo /usr/share/keyrings/docker-archive-keyring.asc \
https://download.docker.com/linux/debian/gpg
RUN echo "deb [arch=$(dpkg --print-architecture) \
signed-by=/usr/share/keyrings/docker-archive-keyring.asc] \
https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
RUN apt-get update && apt-get install -y docker-ce-cli
# TRY TO ADD CA.CRT
COPY ca.crt /usr/local/share/ca-certificates/
RUN update-ca-certificates
keytool -import -trustcacerts -file /usr/local/share/ca-certificates/ca.crt -alias MY_CA -keystore $JAVA_HOME/jre/lib/security/cacerts
# WON'T WORK: /opt/java/openjdk/jre/lib/security/cacerts (No such file or directory)
# Switch back to the Jenkins user
USER jenkins
# Install Jenkins plugins
RUN jenkins-plugin-cli --plugins "blueocean docker-workflow" |
you don't need to pass |
Thanks for the help! I was able to also find the actual certs at edit: spoke too soon edit2: issue was my agents did not have the ca crts installed. Jenkins works fine |
What feature do you want to see added?
I would like to be able to e.g. volume map my root CA cert into a location in the Jenkins container and have the image import that/those cert(s) into the keystore being used by Jenkins at startup.
Upstream changes
No response
The text was updated successfully, but these errors were encountered: