Contain Yourself with Docker

 Here is a small guide into Docker and its functions.

DOCKER

Creation and deployment of applications has never been easier and since its inception, the tech world realized the potential of Docker and containers.

Before going into the details of Docker, let us first look into the necessity for it in development.

Why is Docker Necessary?

In the process of development of an application, there are different groups of people who will require the application, in terms of development, testing and other operations.

After an application has been developed, it has to be sent to a testing team to undergo the necessary testing for the system. When the application is being transferred from one team to another, it would also be necessary to transfer all the necessary dependencies, libraries and similar files as well as the OS features required by the application. 

Hypervisors

Assuming that Docker and the features that it allows are absent, the solution that developers would take would be to make use of some kind of Hypervisor or Virtual Machine such as VMWare in order to create a simulation of the development environment. 

In this case of a hypervisor, what would happen is that on the hardware of your device, there would be an operating system. On that OS, a hypervisor would be installed, on top of which another OS can be installed.

It is possible to create an image of this OS that has been installed on the Hypervisor or Virtual Machine and "ship" it to another system, where the environment would be the same as on the parent computer. When this image it created and shipped, the recipient can create an instance of this image and the environment would be the same as when it was shipped.

Following the same example, if the development team has created an application, it is possible to deliver the system to the testing team by creating an image of it through the hypervisor, which the testing team can thereafter, run on their own virtual machine.

This is a fantastic solution for the problem, but it does have its own drawbacks. This brings us to the problems with hypervisors

The Problem with Hypervisors

While this is a solution that has been widely used and it still used by some companies, there is an issue that is posed by hypervisors. When multiple applications need to be run, there will be multiple operating systems that would need to be installed on the hypervisor, meaning that multiple operating systems would be run on the same physical hardware. 

This would be a strain on the machine and use up a lot of resources, such as memory and CPU. 

To remedy these issues, containers were introduced.

Docker Containers

When it comes to Docker, it works on the basis of containers.

The structure for using Docker on a machine would be as follows;


When Docker is installed on a system, it is possible to create multiple containers in it.

Each of these containers would contain an image of a fully-fledged application with all the dependencies, libraries, OS features and all other necessities.

Once an application is created, it can be packed into a container with all the required files and the container would have an instance of an image of the application that is created.

The beauty of this technology is that you can create your own container with all the files, dependencies and frameworks that are required. If this container needs to be shipped to another system, an image of it can be created and shipped and the recipient can create an instance of it inside a container.

Further, all the containers that are within Docker have their own specific function, along with their own CPU processes, their own isolate OS and other functions. None of these containers hinder the processes of other containers or the Host OS which is running on the hardware.

Docker is intelligent enough to identify identical resources used by each container and maintain only one copy of that resource and provide it when necessary.

You can create your own Docker images or pull from already existing images.

Docker is a helpful tool to ensure that none of the resources in your computer are overused when applications are being run.

The Docker CLI helps to manage all the images, volumes and to run containers.


Comments

Popular Posts