Automatic code Deploy in docker with Jenkins

Description:

In this blog you see When developer push code on Github then code automatic deployment in docker with help of jenkins . I use Shell script for docker and run and detect docker is install or not in machine .

Step To create Job :

  1. Create Job
  2. Select freestyle
  3. Click ok

=> I created Job1 .

Docker.sh (Shell Script) For docker detect and run and Jenkins job is use for run job periodically .

This Above code will create a

  1. docker repo
  2. Install Dokcer
  3. Launch Container
  4. Copy html files in /var/www/html
  5. Restart httpd services

Output :

Go to into Docker and See the Code which pull from the github by jenkins .

-> Put HostIP:8085

Note : If you face any issue about denied then change /etc/sudoers file

and write Below Line

Thank you ….

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store