Public | Automated Build

Last pushed: 18 days ago
Short Description
Jenkins image used for SE demos
Full Description

dockersolutions/jenkins

docker image for jenkins

To pull this image:
docker pull dockersolutions/jenkins

Example usage

docker run -d --restart=always -p 8080:8080 --name jenkins \
  -e DTR_URL=<dtr-fqdn> \
  -e DEMO_MASTER=<demo-master-ip-or-host> \
  -e DOMAIN_NAME=<domain-name> \
  -e GITHUB_USERNAME=<github-username> \
  -e GIT_SERVER=https://github.com \
  -v ucp-node-certs:/etc/docker:ro \
  -v jenkins-data:/var/lib/jenkins \
  dockersolutions/jenkins

Jenkins runs as the user jenkins in the container. The jenkins user uid & gid are 510 in case a volume is used for the data in /var/lib/jenkins.

Jenkins User accounts

  • Purpose: This account is the main Jenkins account to be used interactively

    • Username: demo
    • Password: docker123
  • Purpose: This account should be used to trigger GitHub Webhook for the Jenkins (GitHub plugin) service.

    • Username: github
    • Password: roflmywaffles
    • Example webhook: https://github:roflmywaffles@jenkins.<your-domain-name>/github-webhook/

Interactive Updates

Make sure all files are owned by Jenkins:

sudo chown -R 510:510 jenkins/

Run a container:

docker run -it --rm -p 8080:8080 --name jenkins \
  -v ${PWD}/jenkins/jobs:/var/lib/jenkins/jobs \
  -v ${PWD}/jenkins/users:/var/lib/jenkins/users \
  --entrypoint java \
  dockersolutions/jenkins \
  -jar /usr/share/jenkins/jenkins.war

Run as a service:

docker service create \
  --replicas 1 \
  --constraint 'node.hostname == mbentley-master' \
  --env DTR_URL=dtr.demo.dckr.org \
  --env DEMO_MASTER=172.31.16.122 \
  --env DOMAIN_NAME=demo.dckr.org \
  --env GITHUB_USERNAME=mbentley \
  --mount type=volume,source=jenkinstest-data,destination=/var/lib/jenkins,readonly=false \
  --network ucp-hrm \
  --label com.docker.ucp.mesh.http.8080=internal_port=8080,external_route=http://jenkins.demo.dckr.org \
  --name jenkins \
  dockersolutions/jenkins:latest

In order to pull Jenkins configuration updates, you need to pull the file out of the running container:

docker cp jenkins:/var/lib/jenkins/config.xml .

This file can not be a volume because Jenkins actually rotates the file itself so the bind mount doesn't work as expected. Changes in this file would be system wide configuration variables, views, etc.

Docker Pull Command
Owner
dockersolutions
Source Repository