Docker

PreranaMalagi
Catalysts Reachout
Published in
3 min readNov 6, 2022

What is Docker?

Docker is a platform which is used for easy transfer of files. In which, the same file can be run in different systems, no problem of “But this is running fine in my system!!” Docker helps in packing the file with all it’s dependencies which is easy for shipping. Docker is a company.

Deep understanding of problem faced.

For example: An employee was given work to do it and present tomorrow, and in the office due to some other work, that employee could’nt complete that presentation, so, as in the employees home, system was there, he says: ”I’ll complete this work at home”. And as said, the employee completes presentation on python code in home successfully! And copies that presentation python code and takes it to office, and as soon as employee tries to run it in office system, The code compile was unsuccessful! Because the employee had done the code in python in his home in a different version as that of office. Due to different versions of python in employees home system and office system the dependencies are different. This was the major problem !! So, to resolve this, Docker was introduced!.

What Docker does??

Docker will create a separate container where the python code and all it’s dependences will be present and from the above example, when the employee tries to copy the code at that time the whole container will be copied with it’s dependencies. As the whole container is copied with it’s dependencies so, when the employee runs the code in his office, it runs successfully!. (point to be noted: “docker should be present in employees home system”)

Structure of Docker.

We need to make an image then when we run it , it forms container . Let us understand these terms!

The 3 main terms are:

1. Docker file: Docker file contains text document that contains all commands which user can use to assemble an image. Like to make our image, which is our parent image? Our parent image can be Ubuntu, Java etc. (There is no extension for Docker).

2. Docker image: It is the template of the container which will contain the dependencies, application code

3. Docker container: It contains packages to run application

Docker Processing using commands :

There are 15 docker commands:

1. docker -version : Used to get currently version of docker.

2. docker pull : Used to pull images from docker repository.

3. docker run : Used to create container from an image.

4. docker ps: Used to list the running containers.

5. docker ps -a: Used to show all running and exited containers.

6. docker exec: Used to acces the running container.

7. docker stop : Used to stop the running container. (gives time )

8. docker kill : Used to kill the execution immediately. (does’nt gives time)

9. docker commit: Used to create an new image in an edited container of local system.

10. docker login : Used to login

11. docker push: Used to push an image into docker hub.

12. docker images: Commands list of all local stored docker images.

13. docker rm: Used to delete a stopped container.

14. docker rmi : Used to delete an image from local storage.

15. docker build : Used to build an image from specified docker file.

That’s it for this week!

Well, I hope you gain interest in reading the article about Docker!

--

--