Skip to main content

Docker Tutorial Part-1

Docker is Container management service used by the developers to develop applications and put that in the container created by docker, so that they can easily deployed anywhere.

Companies can ask about Docker basics during the interview as it is widely used by developers now a days. So it is good idea to have basics ready for the interview.

First, you need to download Docker and install. Once you install, you can see the Docker terminal, open the terminal and write the first command as

docker run hello-world

This command will download the hello-world image if it is already not present and then run hello-world as container.

If the command is successful then you will see

Hello from Docker!
This message shows that your installation appears to be working correctly.

You can also look for Docker images available on your system as

docker images

hello-world

How to Build the Docker images?

To Build the docker images you need to create Docker file named as Dockerfile and build it.

Sample Docker file:

FROM ubuntu

MAINTAINER 2p4int@gmail.com

RUN apt-get update
RUN apt-get install -y python python-pip wget

ADD test.py /home/test/test.py

CMD ["echo", "created image"]

This docker file starts from keyword FROM, which tells docker about the base image from which you want to create your image, so it takes from Ubuntu base image.

Next we RUN the dependencies and ADD out python file in the directory /home/test inside the docker container.

Now, keep the Dockerfile and test.py in the same folder and build the image by moving to the directory of folder and run the below command

docker build -t your-new-image-name .

(Don't forget the dot at the end)

This will create the docker image with your new image name on your system.

Now, you can check again all your images using docker images.

Once you created your docker image you can run it to create the container using the command

docker run -it --rm -p 8888:8888 your-new-image-name

Now this will create the container with some random name on your system which you can check using

docker container ls

We will discuss the DockerFile with all the commands and more usage of Docker container in our next blog posts.


Comments

Popular posts from this blog

Tricky Questions or Puzzles in C ( Updated for 2026)

Updated for 2026 This article was originally written when C/C++ puzzles were commonly asked in interviews. While such language-specific puzzles are less frequent today, the problem-solving and logical reasoning skills tested here remain highly relevant for modern Software Engineering, Data Engineering, SQL, and system design interviews . Why These Puzzles Still Matter in 2026 Although most Software &   Data Engineering interviews today focus on Programming, SQL, data pipelines, cloud platforms, and system design , interviewers still care deeply about how you think . These puzzles test: Logical reasoning Edge-case handling Understanding of execution flow Ability to reason under pressure The language may change , but the thinking patterns do not . How These Skills Apply to Data Engineering Interviews The same skills tested by C/C++ puzzles appear in modern interviews as: SQL edge cases and NULL handling Data pipeline failure scenarios Incremental vs ...

Decorators in Python

Decorators provide additional functionality to the functions without directly changing their definition of them. Basically, it takes the functions as an argument, adds functionality to them, and returns it.  Before diving deep into the concept of Decorators, let's first try to understand  What are functions in Python and what is an inner function? In Python everything is Objects, be it Class, Variables, and Functions . So functions are python first-class objects that can be used or passed as an argument. You can store the functions in variables, you can pass a function to another function as parameters, and you can also return the function from the function. Below is one simple example where we are treating functions as objects . def make_me_lowercase ( str ): return str .lower() print (make_me_lowercase( "HELLO World" )) copy_of_you = make_me_lowercase print (copy_of_you( "HELLO World" )) The output of the above calls for both the functio...

Program to uncompress a string ie a2b3c4 to aabbbcccc

Below is the program to uncompress a string #include<stdio.h> #include<conio.h> #include<stdlib.h> int main() { char str[100]="a2b3c4d8u7"; for(int i=0;str[i]!='\0';i++) { if(i%2!=0) { for(int j=0;j<atoi(&str[i]);j++) { printf("%c",str[i-1]); } } } getch(); } Want to become a Data Engineer? Check out below blog posts  1.  5 Key Skills Every Data Engineer needs in 2023 2.  How to prepare for Data Engineering Interviews 3.  Top 25 Data Engineer Questions