Learn Python

Learn Data Structure & Algorithm

Learn Numpy

Learn Pandas

Learn Matplotlib

Learn Seaborn

Learn Statistics

Learn Math

Learn MATLAB

Learn Machine learning

Learn Github

Learn OpenCV

Learn Deep Learning

Learn MySQL

Learn MongoDB

Learn Web scraping

Learn Excel

Learn Power BI

Learn Tableau

Docker Introduction

Docker File, Image & container

Docker using with ml-model

Learn Hadoop

Docker Introduction

Why and what is Docker?

Suppose you are staying at R house and you want to change your house and you want to shift to A house. There can be a lot of things like a chair, table, computer, bed, etc in your house(R). If you want to shift R house to A house then you also have to shift or transfer all the products one by one in house A. It may possible that if you transfer all the products one by one, you can miss a or multiple items while transferring, because there are so many products or items in R house. Now suppose you forget to shift or transfer the computer from house R to A. This is a problem. To solve this problem what you can do is that you can create a container and in the container, you can put all the products and then just transfer the container to house A from house R. If you do this then you will not miss any of the products of your house(R). After transferring open the container and unpack all the particular items and keep the items in house A.

So similar problems happen in companies.
Suppose there is developer R. He is trying to work on a web application. After creating the web application he tests that application in the developer machine and the output is perfect. After creating the application he sends the application to the QA team for testing. But when he send that application to the QA team, the QA team can't run the application or the output is so bad or there can be a lot of bugs. But the application works perfectly on the developer machine.
There can be a lot of reasons for this problem like different operating systems, different hardware configurations, etc.

To solve this problem what we do is that, we put this application into a container. We will put all the required configurations(like required packages, software, etc) to run this application, in the container. Then we will just take the container and put it in the QA machine and install it.

The strategy or advantage of docker is that it fixes the environment Standardization and build the container at once and you can deploy that anywhere.

What is docker file?

Suppose you want to make a burger. To make a burger you must need some ingredients like bread, chicken, sauce, etc. So at first, we will take a page and will note down all the ingredients and the quantity. After that, we will get the ingredient according to the quantity and will start to make a burger.
So the first step will be to create a script of ingredients and quantity. In docker, we do the same thing. Docker file is a text document where we write commands to install all the necessary libraries, packages, or software. Suppose you need MySQL and python. So we will create a docker file and in the file, we will write the commands to install python or MySQL. These are those commands which we wrote in the terminal or command prompt to install a software or package or library.By using this docker file, we create docker image.

What is docker image?

Docker image is a template where all the necessary things and our program files are present by which we will create a docker container. Suppose you want to run an application. To run that application all the necessary software will be present in the image but here the command will not execute. Here we will just collect all the important things. Suppose we created a docker file to install MySQL and python. We also have our program or coding file. Now we will create a docker image where docker file and program or coding files will be present. After creating a docker image you can't change anything, you will be only able to read it.

So at first, we create a docker file and then using that docker file and coding files and other files, we will create docker image.

What is docker container?

Docker container is a container or environment where your program(code) and to run that program all the necessary software, tools, setting, and libraries installing commands will be present. So when you try to run your code or program on another computer using docker, all the necessary things will be automatically get installed in that computer and you can run your program or code easily without any problem.


So the flow is:
Docker file->Docker image->Docker container

CodersAim is created for learning and training a self learner to become a professional from beginner. While using CodersAim, you agree to have read and accepted our terms of use, privacy policy, Contact Us

© Copyright All rights reserved www.CodersAim.com. Developed by CodersAim.