What is Docker?

Today I am going to explain Docker, an open-source software.



What is Docker and Why it is used?


Docker is an open-source software platform that is used for building applications or software, running applications, testing applications, and many other tasks. Docker is based on containers which is a small, isolated, lightweight, and virtual execution environment that makes shared use of the operating system kernel but runs in isolation from one another. Dockers are famous as it enables developers to easily pack, ship, and run any application as it is a lightweight, portable and self-sufficient container that can run virtually anywhere. 


Sometimes while deploying our application or software from one platform to another we face some incompatibility issues which lead to headaches to developers. It is mainly because of differences in an operating system, different configurations of the system, different versions of software, different dependencies, and many other possibilities. Developers spend a lot of time fixing these issues which is a waste of time and money. In this case, the containers help a lot as container's once set up for software can run on any operating system as it depends only on the container not on an operating system now. The container will have all the dependencies which are required to run the Software.


Docker is an open-source project is launched in 2013 which helped in popularizing the technology by making it easier for developers to package their software by “build once and run anywhere” (concept of Docker).


History of Docker


Docker was founded by Kamel Founadi, Solomon Hykes, and Sebastien Pahl during the Y Combinator Summer 2010 startup incubator group and it is launched in 2011. Docker was first released as an open-source platform in March 2013 by the name of dotCloud in Santa Clara at Pycon. It used Linux Containers as its default execution environment which is later replaced with its component called libcontainer and it was written in Go programming language. Within a few months, Docker saw a large number of users and later it obtained a partnership with Red Hat. Hykes was the first who performed a demo of Docker at PyCon in March 2013.


Terminologies necessary for starting with Dockers


Container - It is a unit that packs the actual application and all the required dependencies and libraries required for development, testing, or running the Software. It runs the application quickly and reliably. They are highly suitable for a microservices architecture in which applications are broken into small, self-sufficient components, which can be deployed and scaled individually. It also solves the problem of incompatibility issues while deploying from one server to another. Containers do not require a separate operating system and therefore use fewer resources. Hence they are preferred over Virtual Machines.

Docker Image - Docker image is a set of portable, read-only, executable templates or files that are downloaded from docker repository which contains instructions to set up an environment for running the container with custom functionalities. It also contains the specifications for which software components in the container will run.

Dockerfile - Every Docker container is provided with a file. Dockerfile is a text file that provides the syntax to build a docker image to set up the container environment. It also includes the instructions for an operating system, languages, environment variables, network ports. Dockerfile also helps in setting up a layer in the image.

Docker run - Docker run is the command that creates a container from a given image and launches the container. The docker run command first creates a writeable container layer over the specified image and then starts it.

Layer - Docker image is built up of several layers of files. Each layer represents an instruction in the image’s Dockerfile. The layers are stacked on top of each other. Moreover, Docker uses the storage drivers to store image layers and also to store data in the writable layer of a container. Layers are bound together according to dependency.

Docker HubDocker Hub is a service where container images can be stored, shared, and managed by teams. It is a platform like GitHub but owned by Docker and contains containers instead of repositories.

Docker ComposeDocker Compose is a command-line tool that was developed to define and share multi-container Docker applications. It uses YAML files to configure Docker applications services. It allows users to create, start, stop, and rebuild all the services from your configuration and allows you to view the status and log of all running services.

Docker Volume - Docker volumes are widely used for data persistence while we work in Docker containers. It maintains a folder on the host machine that can be represented inside the container. This allows users to have backup data and allows them to share file systems between containers easily. They are a better alternative than compiling additional writable layers which increase Docker image size.

Docker EngineDocker Engine is a layer on which Docker runs. It is installed on the host machine. It’s a lightweight runtime and tooling which manages the containers, images, builds, and more other items. It is client-server technology that creates and runs the containers using Docker components and services. Docker engine includes a daemon (dockerd) as well as it's CLI (docker).

Docker DesktopDocker Desktop is software that enables you to build and share containerized applications and microservices. Docker Desktop includes Docker Engine, Docker CLI client, Docker Compose, Docker Content Trust, Kubernetes, and Credential Helper.

Advantages

Consistent and Isolated Environment - Docker allows users to build containers that are completely independent of other applications and provides consistency and an isolated environment. It enables developers to easily pack, ship, and run any application as it is a lightweight, portable and self-sufficient container that can run virtually anywhere. So the developer does not need to worry about the dependency and the environment.

Performance - As we all know Virtual Machines are an alternative to Containers but the containers do not contain an operating system whereas Virtual Machines need to have an operating system to work which makes the containers faster and quicker than Virtual Machines.

Portability - Containers are only required to be configured only once. Once you have set up and tested your containerized application you can easily deploy it to any other system where Docker is running and your application will perform exactly as containers are independent of the system.

Fast Rollback - Docker containers can create and delete an environment at a very fast pace. Suppose while working in the containers you have performed some mistake and you want to reset the container back to a healthy state, this process is very easy as compared to Virtual Machine.

Disadvantages

Security - Security is always a major concern for online things. As there is no full operating system involved with containers you will find that hackers are mostly targeting the systems that are hosted in containers and not secured properly.

Graphical applications don't work wellDocker is not a good solution for applications that require a rich graphical interface. Initially, Docker was designed for deploying server applications that don't require a graphical interface.

Cross-Platform Compatibility - Docker provides cross-platform compatibility that is if an application is designed to run in a Docker container on Windows then it can't run on Linux. You can simply understand it as images run on the same kernel as the host so an image that is made for x86 architecture will not run on ARM.

Same Kernel Problem The containers share the same kernel and are therefore less isolated than Virtual Machines. A small bug in the kernel can affect every container. And it is a possibility that the containers will go down and also a possibility of a loss of data in containers.

References

Docker Documentation - https://docs.docker.com/



That's all for this Post. Happy Coding ðŸ˜‡
Chirag Goel

I am a developer, likes to work on different future technologies.

Post a Comment (0)
Previous Post Next Post