Let’s Docker It!

Let’s Docker It!

We all use various tools on different environment platforms. But what if an application running on developer’s environment is not compatible with the user’s environment? This is solved by using Docker. What exactly is Docker? When and Why to use it? What benefits does Docker provide?


No alt text provided for this image

 (Source: Internet)

Challenges faced by organizations are:

  • Unavailability of environments.
  • Lack of environment compatibility and configuration skills.

What is Docker?

Docker tool is designed to make easier creation, deployment, and run applications by using containers. Docker is similar to a virtual machine. Docker is open source. Meaning anyone can contribute to Docker and modify it to fulfilling their own needs, if they need additional features that aren't available .

What is the difference between VM and Docker?

?A virtual machine creates a whole new virtual operating system(OS). Whereas Docker allows applications to use the same Linux as the operating system that they're running on. And if one requires applications that are not already running on OS those can be shipped through packages. This increases the performance and reduces the size of the application. These are done with the help of containers.

What are Containers?

CONTAINERS-Containers are a thought of a developer at the application layer that packages code and dependencies together in one package. Multiple containers can run on the same machine and also share the same OS kernel with other containers. Each runs as isolated process in user space. Containers take less space than VMs (containers are few MBs in size) and can handle more applications. Whereas Virtual machines (VMs) includes a copy of an OS, the application, necessary libraries thus consuming GBs of space. VMs can also reduce booting speed.


No alt text provided for this image

Diagram:   a) VM used                                b)Containers used

Whom is Docker for?

Docker is a tool that is designed to benefit both developers and system administrators, making it a part of many DevOps toolchains. Developers can focus on writing code without worrying about the environment that it will finally be running on. For operating purposes Docker gives flexibility and potentially reduces the number of systems needed to run the application.

When to Use Docker?

Learning new technologies: Docker offers an isolated and disposable environment through containers so projects can be maintained with Docker images already installed and configured.

Isolate an app: If you want to run multiple applications on one host but different environment, you can keep components of each application in separate containers to prevent problems.

Developer teams: If developers are working on different setups then Docker provides a convenient way to do it.

How does a Docker help in CI/CD?

Dockers helps developers to build and test their code in any environment they want. Hence Docker helps to spot bugs early in the application development. Dockers help to save time on builds and allows developers to run parallel tests on them.

Dockers integrates with repository tools like GitHub and Integration tools like Jenkins. Developers commit the code into GitHub, test the code that automatically builds, creating an image using Jenkins. This image can be added to Docker registry to deal with different issues between different environment types.

Why to use Docker?

1.   Isolation: Settings within a container will not affect any configurations or installations on your computer, or on any other containers that may be running. You can have multiple projects on a single server without fearing about creating clashes on your system.

2.   Security: Separating various components of a large application into different containers can have security benefits. If one container is adjusted or updated the others remain unaffected by the changes.

3.   Docker Hub: Docker Hub is used to store and well-maintained images available. It makes the setup process extremely fast and simple. It is easy to quickly pull image or build from maintained Docker file.

4.   Environment Management: Docker makes it easy to maintain and implement different versions of application. You can have a separate container for testing and development on the same OS and easily deploy to each one.

5.   Continuous Integration and Delivery(CI/CD): Docker works well as part of continuous integration with tools like Travis and Jenkins.

Every time your source code is updated, these tools can save the new version as a Docker image, give it a version number and push image into Docker Hub, then deploy it to production. Thus, Docker has become an early adopter in Continuous Integration and Continuous Deployment.

Perks of Docker:

  • Reduce issue of inconsistent environments.
  • Any machine that is running Docker tool can use a Docker Image.
  • Save time on build process.
  • Allow developers for parallel testing.


No alt text provided for this image

(Source: Internet)

Thus ,the nature of Docker containers is to fasten the rapid test cycles. Docker helps users with unchanging processes for easy creation of production and configuration of environments.


References:

https://en.wikipedia.org/wiki/Docker_%28software%29

https://www.docker.com/






Sayali Shinde

SSR Software Engineer | Globant | React Native

5 年

Nice article

回复

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

社区洞察

其他会员也浏览了