{GitHub + Docker + Jenkins} MlOps & DevOps Task2

This article is a simple integration of GitHub, Jenkins and Docker to automate the process of deploying a website by creating custom Docker images using Dockerfile.






Let’s start with the workflow for this task:

Dockerfile created successfully.
cmd>> docker build -t mkos:m1 .
docker run -it --name mk --privileged -p 2514:8080 -v /:/host mkos:m1

After completing the Jenkins installation with the required plugins(GitHub, SSH, E-mail etc. ) we are ready to proceed further :

JOB #1 :

After doing the successful setup of Jenkins in your local host now create a new item to start our task, In the task as mentioned at the start, We have to build the first Job which can automatically pull repo from your GitHub Repo just by giving some triggers.

It is clearly showing in the above images, We have to copy the HTML file which we cant to display as output bypassing to job2 for running on the web server. You can find shell command here.

sudo cp {file name} {dir}

JOB#2 :

docker pull httpd
systemctl start httpd
later i changed port no to 8950 as 2514 is being used by Jenkins.


This is just the simple testing job that checks the other jobs that are they working fine or not.

JOB#4 :

JOB#5 :

This job will work in monitor the system, Like if the system fails then it will automatically start a new container to don’t make a failure in the project.

We will use SCM polling for this, * here represents 1min.

We will add some commands which will be used for launching a new container after a system failure.

Here comes the full setup :

So, Here is the beautiful output for the above task.

Thanks for reading…

LinkedIn profile: https://www.linkedin.com/in/mayank-varshney-62744a163