Docker...

Docker...

Container:

A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.

or we can say in other words...

A container is a bundle of Application, Application libraries required to run your application and the minimum system dependencies.

Docker:

Docker is a containerization platform that provides easy way to containerize your applications, which means, using Docker you can build container images, run the images to create containers and also push these containers to container registries such as DockerHub, Quay.io and so on.

In simple words, you can understand as containerization is a concept or technology and Docker Implements Containerization.

  • Docker is an open source containerized platform designed to create, deploy and run the applications.
  • Docker uses container on the host os to run application. It allows application to use the same Linux kernel as a system on the host computer rather than creating a whole virtual machine.
  • We install docker on any os but docker engine runs natively on Linux distribution.
  • Docker written in go language
  • Docker is a tool that performs os level virtualization also known as containerization.

Advantage of Docker:

  • No Pre-allocation of RAM
  • less cost
  • It can run on physical/ virtual hardware or on cloud.
  • we can reuse the image.

it took very less time to create the container.

Disadvantage of docker:

  • Difficult to manage large amount of container.
  • Docker does not provide cross-platform compatibility mean if an application is designed to run in a docker container on windows, then it can not run on Linux or vice-versa.
  • Docker is suitable when the developments os and testing os are same, if the os is different , we should use VM(virtual machine)
  • No solution for data recovery and backup.

Docker Architecture:

The above picture, clearly indicates that Docker Daemon is brain of Docker. If Docker Daemon is killed, stops working for some reasons, Docker is brain dead.

Docker Lifecycle:

We can use the above Image as reference to understand the lifecycle of Docker.

  1. docker build -> builds docker images from Dockerfile
  2. docker run -> runs container from docker images
  3. docker push -> push the container image to public/private registries to share the docker images.

Components of Docker:

Docker Daemon:

  • Docker daemon runs on on the host os.
  • It is responsible for running container and manages docker services.
  • Docker daemon can communicate with other daemon.

Docker client:

  • Docker users can interact with docker through a client.
  • Docker client uses command and rest API to communicate with docker daemon.
  • When a client runs any server command or the docker client terminal, the client terminal sends these docker commands to the docker daemon.
  • it is possible for docker client to communicate with more than one daemon.

Docker Host:

Docker host is used to provide an environment to execute and run applications it contains the docker daemon images containers networks and storages.

Docker Hub:

  • Docker hub manages and stores the docker images.
  • there are two types of registry in the docker 1. Public Registry: it is also called docker hub. 2. Private registry: it is used to share image within the enterprise.

Docker Image:

  • Docker image are the read only binary templates used to create docker container.
  • Single file with all dependencies and configuration required to run the program.
  • You might create your own images or you might only use those created by others and published in a registry. To build your own image, you create a Dockerfile with a simple syntax for defining the steps needed to create the image and run it. Each instruction in a Dockerfile creates a layer in the image. When you change the Dockerfile and rebuild the image, only those layers which have changed are rebuilt. This is part of what makes images so lightweight, small, and fast, when compared to other virtualization technologies

Dockerfile:

Dockerfile is a file where you provide the steps to build your Docker Image.

Docker registry:

A Docker registry stores Docker images. Docker Hub is a public registry that anyone can use, and Docker is configured to look for images on Docker Hub by default. You can even run your own private registry.

When you use the docker pull or docker run commands, the required images are pulled from your configured registry. When you use the docker push command, your image is pushed to your configured registry. Docker objects

When you use Docker, you are creating and using images, containers, networks, volumes, plugins, and other objects. This section is a brief overview of some of those objects.

Install Docker:

You can create an Ubuntu EC2 Instance on AWS and run the below commands to install docker.

sudo apt update

sudo apt install docker.io -y



要查看或添加评论,请登录

Rakesh Kumar的更多文章

  • Docker..

    Docker..

    What is container? A container is a standard unit of software that packages up code and all its dependencies so the…

  • Git and GitHub...

    Git and GitHub...

    Login aws account----> create two EC2 instance Commands:- sudo su #for admin command apt-get update -y #to update…

  • GIT and GitHub....

    GIT and GitHub....

    Version control system Stages of git/workflow Stages of git and its terminology Introduction: It is the software…

  • Interactive file and explorer

    Interactive file and explorer

    description:- we will create a bash script that serves as an interactive file and directory explorer. The script will…

  • Basic of bash scripting

    Basic of bash scripting

    Here we will cover the basics of bash scripting. Task1:Comments In bash scripts, comments are used to add explanatory…

社区洞察

其他会员也浏览了