# Container for running Jenkins with a local jobs volume
# Run this image via
#   - `docker-compose -f jenkins.yml -p <%= machineName %> run jenkins`
version: '2.1'

services:
  jenkins:
    image: phase2/jenkins-docker:1.9.1
    volumes:
      # Primary jenkins configuration. Direct file mount prevents writing updates from running instance.
      - ./env/jenkins/config.xml:/var/jenkins_home/config.xml
      # Mount the local project jobs into Jenkins
      - ./env/jenkins/jobs:/var/jenkins_home/jobs
      # Mount the docker socket so we can execute from within this container
      - /var/run/docker.sock:/var/run/docker.sock
      # Mount a stable location for the Jenkins workspace
      - /opt/development/<%= projectName %>/jenkins/env/workspace:/opt/development/<%= projectName %>/jenkins/env/workspace
      # SSH key grants read access to private Git repositories.
      - ~/.ssh/${DEVTOOLS_SSH_KEY:-id_rsa}:/root/.ssh/devtools.key
    environment:
      VIRTUAL_HOST: build.<%= host.devcloud %>
      VIRTUAL_PORT: 8080
    labels:
      com.dnsdock.name: jenkins
      com.dnsdock.image: <%= domain %>

# Container for running Jenkins with a local jobs volume
# Run this image via
#   - `docker-compose -f jenkins.yml -p <%= machineName %> run jenkins`
version: '2.1'

services:
  jenkins:
    image: phase2/jenkins-docker:latest
    volumes:
      # Primary jenkins configuration. Direct file mount prevents writing updates from running instance.
      - ./env/jenkins/config.xml:/var/jenkins_home/config.xml
      # Mount the local project jobs into Jenkins
      - ./env/jenkins/jobs:/var/jenkins_home/jobs
      # Mount the docker socket so we can execute from within this container
      - /var/run/docker.sock:/var/run/docker.sock
      # Mount a stable location for the Jenkins workspace
      - /opt/development/<%= projectName %>/jenkins/env/workspace:/opt/development/<%= projectName %>/jenkins/env/workspace
      # SSH key grants read access to private Git repositories.
      - ~/.ssh/${DEVTOOLS_SSH_KEY:-id_rsa}:/root/.ssh/devtools.key
    environment:
      VIRTUAL_HOST: build.<%= host.devcloud %>
      VIRTUAL_PORT: 8080
    labels:
      com.dnsdock.name: jenkins
      com.dnsdock.image: <%= domain %>

Update Jenkins docker image to use 'latest'.
Update Jenkins docker image to use 'latest'.
