Skip to main content

Command Palette

Search for a command to run...

Docker Project for DevOps Engineers

Updated
Docker Project for DevOps Engineers
R

Rajat Chauhan is a skilled Devops Engineer, having experience in automating, configuring, deploying releasing and monitoring the applications on cloud environment.

• Good experience in areas of DevOps, CI/CD Pipeline, Build and Release management, Hashicorp Terraform, Containerization, AWS, and Linux/Unix Administration. • As a DevOps Engineer, my objective is to strengthen the company’s applications and system features, configure servers and maintain networks to reinforce the company’s technical performance. • Ensure that environment is performing at its optimum level, manage system backups and provide infrastructure support. • Experience working on various DevOps technologies/ tools like GIT, GitHub Actions, Gitlab, Terraform, Ansible, Docker, Kubernetes, Helm, Jenkins, Prometheus and Grafana, and AWS EKS, DevOps, Jenkins. • Positive attitude, strong work ethic, and ability to work in a highly collaborative team environment. • Self-starter, Fast learner, and a Team player with strong interpersonal skills • Developed shell scripts (Bash) for automating day-to-day maintenance tasks on top of that have good python scripting skills. • Proficient in communication and project management with good experience in resolving issues.

  • Create a Dockerfile for a simple web application (e.g. a Node.js or Python app)

  • Build the image using the Dockerfile and run the container

  • Verify that the application is working as expected by accessing it in a web browser

  • Push the image to a public or private repository (e.g. Docker Hub)


Steps to set up the Project:

  • Install Git

  • Install Docker engine

  • Make a directory for your project

  • Clone GitHub repository

Docker File of our application

Breakdown of Dockerfile:

  • This line sets the base image to Python 3.11

  • Sets the working directory inside the container to /app.

  • It will copy all the source code from the local to the container

  • It will update pip and install the required dependencies.

  • The command used to run the app.

Build Docket image from Dockerfile

  • Building a Docker image is a crucial step in containerizing your Flask application.

  • It involves packaging your application and its dependencies into a single, portable image.

  • To build the Docker image, open a terminal and navigate to the directory containing your Dockerfile and application code.

Execute the following command:
1.

2.

Run the Docker image as a container

  • Once you have successfully built your Docker image, the next step is to run it as a container.

  • This involves creating an instance of your image, a runnable environment for your Flask application.

  • Execute the following command in the terminal:

Run the Flask Application on the browser

API Response

Stop Container:

Delete Container:

Push the Docker image to Docker Hub

  • Log in to Docker Hub and create a repository

  • Use the below command to log in on the Ubuntu machine, from where you have to push the image on Docker Hub and provide your username and password.

  • Run below command to push the image

Docker

Part 2 of 6

Docker is a software platform that allows you to build, test, and deploy applications quickly.Using Docker, you can quickly deploy and scale applications into any environment and know your code will run.

Up next

Docker compose and YAML

Docker Compose: Simplifying Multi-Container Applications Docker Compose is an essential tool for defining and sharing multi-container applications. It allows developers to manage multiple containers using a single command, streamlining the process of...

More from this blog

R

Rajat Chauhan

63 posts