Install Jenkins with Docker-Compose¶
Learn how to install Jenkins using Docker Compose.
-
Create
docker-compose.ymldocker-compose.ymlversion: '3.8' services: jenkins: image: jenkins/jenkins:jdk11 restart: always privileged: true user: root ports: - '8081:8080' - '50000:5000' container_name: jenkins_jdk11 volumes: - ~/Desktop/self-hosted/jenkins_home:/var/jenkins_home - /var/run/docker.sock:/var/run/docker.sock- You can map
/var/jenkins_hometo any local location you liked
- You can map
-
Start
docker-compose.ymlas background -
Verify Jenkins container service
-
Get the Jenkins admin password
-
Open your browser, navigate to
localhost:8081, and paste your password