Hands-On with Jenkins and Docker: A Beginner's Journey on AWS EC2

๐Ÿ“š What is Docker?

Docker is a platform that lets you package your application along with everything it needs (code, libraries, dependencies) into a container.
This container can run anywhere โ€” your laptop, a cloud server, or any machine

Docker makes applications portable, lightweight, and easy to run.

Before Docker:

  • Developers manually installed software, libraries, and dependencies.

  • "Does it work on other machines..?" was a common problem.

With Docker:

  • You build once and run anywhere.

  • The same Docker container can be deployed automatically on development, staging, and production.

  • Docker simplifies CI/CD pipelines by making builds, tests, and deployments consistent and repeatable.

difference between VMโ€™s and Docker container:

VM:- Each VM has its own Guest OS, Kernel, virtualized hardware, binaries, and libraries.

Container:-Containers share the Host OS Kernel. Each container packages only its application code, binaries, and libraries.

Dockerfile

Deploying a basic application using docker

Step 1: Take a cloud server instance(EC2 Instance)

step2: setup Jenkins and git

step3: access the Jenkins dashboard to write the pipeline

step4: before cloning the code add the Dockerfile in the code

step5: create a pipeline job and write the pipeline for getting GitHub code, docker-build, docker-run

step6:Build the Job in Jenkins

step7: Access the application using the publicip:Port

Dokerfile

FROM nginx

COPY . /usr/share/nginx/html/

0
Subscribe to my newsletter

Read articles from Purnachandra Rao Patchigolla directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Purnachandra Rao Patchigolla
Purnachandra Rao Patchigolla