Docker Part -2 →Architecture and Commands

Aakib
3 min readJan 10, 2023
  1. Above image showing the architecture of Docker as we discuss earliar docker is the advanced version of virtualisation and installed on the host OS just like installing VM ware on host computer and then we create container of different OS ( say ubuntu) just like you creating and installing ubuntu or window in VM

But the limitations is there in VM we don’t able to use resourses in a better way unlike in docker when we need to run specific Aplication ( OS) we run the container of that image and when we need to free the resourses we stop the container and the work done by you in that apication is save as IMAGE of that container when you run again the container of that image it resumes where it stop

What is Container And Image→

when the Image of a particular application is in running mode it is called container …..And when we stop the container it saves it as a image for example when you click picture you are able to pose but after the picture is clicked the data is save as a image which can’t change ……

Container is the word in docker which defines itself means it is kind Box which is inside in your laptop and Shrinks or expand as your size of data in your container behaves means if data(application size) is increase size of box (say container ) also increases and vice versa and save later as a image unlike your VM in which you pre-allocate the RAM and Storage and then create Virtual Machine in which you are limted to resourses provided on creation.

What Is Client , Daemon , Docker Hub →

Client →when you run any command say docker run at that point you are working with docker client and

Daemon → when we are request any service from docker client such as docker run ubuntu it Asks docker daemon if it present locally in your device or not if it present locally it docker daemon talk to client and say yes it is present and if not present then docker daemon go the docker hub (central registry ) and pull the image from there

DOCKER HUB → is the central registry in which all the dependencies require to run the application is present any thing you need you pull it from there via docker daemon and you can also push the images in docker

Basic commands in Docker →

  1. docker images → // give all the images present in your machine
  2. docker search ubuntu → // search whether the image of ubuntu is present locally and if not present then it pull it from docker hub
  3. docker pull ubuntu → pull image from docker hub
  4. service docker start → checks whether service is start or not
  5. docker start <container name> → start the container
  6. exit → to exit from container
  7. docker attach <container name > → to go inside a running container
  8. docker ps -a →to see all the containers
  9. docker ps → to see only running containers
  10. docker run -it — name <container name> <image name> /bin /bash →to give name to a container
  11. docker stop <container name> → to stop running container
  12. docker rm < container name > → to delete a container

etc… are the basic commands in docker

github docker commands linkshttps://github.com/Aakibgithuber/Docker-commands/blob/main/docker%20commands.txt

IN docker part 3 we discuss

  1. ways to create a image
  2. docker file
  3. docker volume
  4. docker port expose

--

--

Aakib

Cloud computing and DevOps Engineer and to be as a fresher I am learning and gaining experiance by doing some hands on projects on DevOps and in AWS OR GCP