In this tutorial, Quickstart with Jenkins in docker. Jenkins is an automation CI/CD tool. with Jenkins, you can create jobs to build, test and deploy your application. Docker the essential for DevOps Roles.
Table of Contents
Set up Jenkins with docker
Docker compose for Jenkins
You can create “jenkins-docker-compose.yml” file for Jenkins
version: '2'
services:
jenkins:
image: 'jenkins:2.60.3'
container_name: jenkins
user: root
restart: always
ports:
- '8080:8080'
- '5000:5000'
volumes:
- /home/huupv/data/jenkins:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
Note:
- docker.sock with Host in the volume. But be careful, you can delete the container from Docker.
- “/var/jenkins_home” is a place to read docker images. so do not change. If Docker has died, then your data remains and restore if you start it again.
Starting Jenkins with docker
Execute this command as below
docker-compose -f jenkins-docker-compose.yml up
From local, you can access Jenkins at browser at http://0.0.0.0:8080
Conclusion
Through the article, You can “Set up Jenkins with docker“ as above. I hope will this your helpful.
1 thought on “Set up Jenkins with docker”