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 ...

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

Programs and Puzzles in technical interviews i faced

I have attended interview of nearly 10 companies in my campus placements and sharing their experiences with you,though i did not got selected in any of the companies but i had great experience facing their interviews and it might help you as well in preparation of interviews.Here are some of the puzzles and programs asked to me in interview in some of the good companies. 1) SAP Labs I attended sap lab online test in my college through campus placements.It had 3 sections,the first one is usual aptitude questions which i would say were little tricky to solve.The second section was Programming test in which you were provided snippet of code and you have to complete the code (See Tricky Code Snippets  ).The code are from different data structures like Binary Tree, AVL Tree etc.Then the third section had questions from Database,OS and Networks.After 2-3 hours we got the result and i was shortlisted for the nest round of interviews scheduled next day.Then the next day we had PPT of t...