This guide details the steps required to enable HTTPS on the Jenkins docker container. It follows Jenkins documentation: https://www.jenkins.io/doc/book/installing/initial-settings/#configuring-http
It is assumed you have SSL certificates provided.
identity.jks
is your identity store with the server certificatetrust.jks
is your trust store with any trusted certificates (eg. organization CA certs)Create a new directory under the Myst server installation and copy your keystore there named identity.jks
and trust.jks
.
mkdir /opt/myst-studio/conf/data/keystores
Jenkins will publish application metadata to Myst. This is done during the build process. If untrusted, you will see errors during the build process when Jenkins publishes application metadata to Myst.
There are two options. Use one option only.
cacerts
cd /opt/myst-studio/conf/data/keystores
docker cp myststudio_ci:/etc/ssl/certs/java/cacerts trust.jks
Go to the keystores directory
cd /opt/myst-studio/conf/data/keystores
Retreive the certificate from Myst. Change localhost:443
to your myst hostname:port
.
echo -n | openssl s_client -connect localhost:443 | openssl x509 > myst.crt
Load the myst certificate into the truststore.
keytool -importcert -noprompt -trustcacerts -alias myst -file myst.crt -keystore trust.jks -storepass changeit
docker-compose-base.yml
Update /opt/myst-studio/conf/ci/docker-compose-base.yml
.
version: '2'
services:
ci:
image: ci-server
container_name: myststudio_ci
# Ports exposed from Jenkins (external_host:container)
ports:
- 8081:8080
- 8443:8443
- 50000:50000
# Volumes - (external_host:container)
volumes:
- ../data/keystores:/var/jenkins_home/keystores
# Environment Variables
environment:
JENKINS_OPTS: "--httpPort=-1 --httpsPort=8443 -Djavax.net.ssl.trustStore=/var/jenkins_home/keystores/trust.jks --httpsKeyStore=/var/jenkins_home/keystores/identity.jks --httpsKeyStorePassword=changeit"
restart: unless-stopped
A detailed explanation of the changes are in the Appendix.
Restarting will also restart Myst Studio, Artifactory, and Jenkins.
cd /opt/myst-studio/bin
./stop.sh
./start.sh
And you're finished!
- 8443:8443
- 8081:8080
so HTTP is disabled8443
to anything you'd like such as - 8443:443
- 8081:8080
# Ports exposed from Jenkins (external_host:container)
ports:
#- 8081:8080
- 443:8443
- 50000:50000
Links the keystores directory created earlier to the Jenkins container.
# Volumes - (external_host:container)
volumes:
- ../data/keystores:/var/jenkins_home/keystores
Environment variable used by Jenkins on startup.
--httpPort=-1
disables HTTP--httpPort=8080
if you want to allow HTTP too. # Environment Variables
environment:
JENKINS_OPTS: "--httpPort=-1 --httpsPort=8443 -Djavax.net.ssl.trustStore=/var/jenkins_home/keystores/trust.jks --httpsKeyStore=/var/jenkins_home/keystores/identity.jks --httpsKeyStorePassword=changeit"
Check the Jenkins docker logs on the Myst server:
docker logs -f myststudio_ci
Raise a support ticket at https://mystsoftware.freshdesk.com .