Day 17 - Docker Project for DevOps Engineers

Day 17 - Docker Project for DevOps Engineers

Today's challenge is so special Because I'm going to do DevOps project today with Docker.😍

Β·

2 min read

Dockerfile

Dockerfile is basically a text file. It contains some set of instructions.

Automation of Docker image creation.

Docker Components

  • FROM: for the base image, this command must be on the top of the docker file.

  • RUN: to execute commands, it will create a layer in the image

  • MAINTAINER: author/ owner/ description

  • COPY: copy files from the local system (docker vm) we need to provide a source and destination (we can’t download files from the internet and any remote repo.)

  • ADD: similar to copy but it provides a feature to download files from the internet, also extract files at the docker image side.

  • EXPOSE: to expose ports such as port 8080 for Tomcat, port 80 for nginx, etc.

  • CMD: execute commands but during container creation.

  • ENTRYPOINT: similar to CMD but has higher priority over CMD, first commands will be executed by ENTRYPOINT only.

  • ENV: environment variables

Task:

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

2.Build the image using the Dockerfile and run the container

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

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

Hope you all understand!!

Thank you πŸ˜‰

Β