Skip to content

Instantly share code, notes, and snippets.

@roxsross
Created December 29, 2023 23:25
Show Gist options
  • Save roxsross/c3265c42b2c5ebed7c04e16fea0b5398 to your computer and use it in GitHub Desktop.
Save roxsross/c3265c42b2c5ebed7c04e16fea0b5398 to your computer and use it in GitHub Desktop.
Jenkins Docker compose
version: "3.8"
services:
docker:
container_name: docker
image: docker:dind
privileged: true
user: root
restart: always
volumes:
- $PWD/jenkins_home:/var/jenkins_home
- jenkins-docker-certs:/certs/client
environment:
DOCKER_TLS_CERTDIR: /certs
networks:
- security
jenkins:
container_name: jenkins
image: jenkins/jenkins:lts
restart: always
privileged: true
user: root
depends_on:
- docker
volumes:
- $PWD/jenkins_home:/var/jenkins_home
- jenkins-docker-certs:/certs/client:ro
environment:
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_VERIFY: 1
DOCKER_CERT_PATH: /certs/client
ports:
- "8080:8080"
- "50000:50000"
networks:
- security
volumes:
jenkins-docker-certs:
networks:
security:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment