Configuration

Physical Machine

  • Hardware -> Operating System -> One specific application deployed.

Virtualization

  • Takes complete hardware resources, CPU processing power, Memory and RAM etc and started distributing it to various virtual machines using software called Hypervisor.

  • Hardware -> Host Operating System -> Hypervisor -> Guest OS -> Applications deployed.

Containers

  • Hardware -> Host Operating System -> Container -> Applications deployed

Application itself is contained in its own world, can be shipped to deployment.

Faster than Virtualization, Light-weight and Easy Deployment beacuse it directly deals with the Host OS/Hardware.

Docker Process

  • Developed our own App on a ubuntu image.

  • Create a docker file, a set of instructions which helps to build the docker image.

  • Build a docker image and then your docker container will run (with the help of our docker image)

  • Push the docker image to the docker hub and then it will be distributed to the Production Env and the QA

How do we run Docker

docker pull centos

docker pull ubuntu:16.04       // The tag(:), which specifies what version to download 

This command is gonna pull the centos image from the docker hub, to create our containers.

docker run -d -t --name mydockerlinux centos

This command will run our docker centos image which was fetched from the hub with our custom linux name.

docker ps
docker container ls

This command will list all our docker processess which is running in the background.

docker exec -it mydockerlinux bash

This command will execute our centos image and give us a bash shell.

docker system prune -a
docker rm -f (Container ID)

These commands will delete all the containers/images present on the host and reclaims/returns the space utilised.

docker ps --filter "status=exited"
docker ps --filter "status=running"

These commands returns the current status of our docker images.

docker stats

docker start <CONTAINER ID>
docker stop <CONTAINER ID>
docker restart <CONTAINER ID>

These commands helps us to start | stop | restart any of the running containers, the stats command returns us the amount of memory used by the docker image

Last updated