Set up Jenkins with docker

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.

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.

,

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created DevopsRoles.com site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

1 thought on “Set up Jenkins with docker

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.