Set up Jenkins with docker

In this tutorial, Quick start with jenkins in docker. Jenkins is a automation CI/CD tool. with jenkins, you can create jobs to build, test and deploy your application. Docker the essential for DevOps Roles.

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'
      - '50000:50000'
    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

Thought 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 *

Comment moderation is enabled. Your comment may take some time to appear.

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