How to Use Docker Compose With Jenkins



Timecodes ⏱:

00:00 Introduction
00:06 Overview
00:32 Starting point
00:44 Create a GitHub repository
01:14 Create a Jenkinsfile
02:46 Create pipeline job
03:47 Add Docker Compose file
04:13 Update Jenkinsfile
07:07 Run the job again
08:09 Why would you want to run Docker Compose using Jenkins?

#jenkinstutorial #dockercompose

Information referenced in this video:

Sample repository
https://github.com/darinpope/jenkins-example-docker-compose

Jenkins LTS 2.319.3
https://www.jenkins.io/changelog-stable/#v2.319.3

CloudBees on Twitter:

Darin on Twitter:


source

4 thoughts on “How to Use Docker Compose With Jenkins”
  1. Hi, thanks for sharing.

    In fact, that's what I am trying to solve : How to properly execute docker and docker-compose commands, inside a Jenkins already running in docker container !

    It is not obvious here if Jenkins is running in docker container or just installed on host…
    Could you explain how you set the "linux based agent running docker + compose v2 " ??

    Thanks

  2. Another thing I would probably add is to remove the network created by docker-compose before the test and after the test. Also it’s better to hard code the network number instead of let it float. I encounter an issue where the dynamic network docker-compose created duplicated and masked a real network to the npm registry so the test will randomly fail depending how many times the docket-compose has been used on that agent

  3. Hi sir, I'm very new to Docker as well as Jenkins, your video helped me alot.
    Till now everything is clear, but I'm a bit confused,
    How can we actually deploy these Docker containers (which was included in the docker-compose stack)
    automatically to dev or production server remotely.

    like:
    Transfering the code
    running docker-compose up

    and what if the docker-compose file also has bind volume mounts?

    I'm very confused, how can I do these things 🙁

    If possible please make a video on this, or suggest some resources from where I can learn.

    Thank you so much sir 🙂

Leave a Reply

Your email address will not be published.

Captcha loading...