Mallow's Blog

Docker

Seems a bit too technical? Let’s break it down and make use of this excellent tool to improve our productivity and remove the problem of an “inconsistent environment” altogether. Here we are going to simplify what docker is and how it will make wonders if we use it correctly.

Our topic will cover:-

what problems we are trying to solve with docker?

what are docker and docker containers?

how we can use it to improve our development workflow?

What are some Barriers to Docker Usage?

What problems we are trying to solve with docker?
There are a dozen of reasons to use Docker. Here we will focus on mainly on: consistency, speed, and isolation.
Consistency:
Before getting into the actual explanation of how docker could eliminate development environment inconsistency, let’s try to understand few things first. All the applications that exist or the ones that we are developing are composed of a programming language, a framework on top of that programming language, system libraries, and other packages that are needed for the application to work as expected, we call all these “Applications Dependencies”. These application dependencies have versions and different versions of these dependencies may bring different functionalities to the application.
Let’s look into an example, let’s say you are developing a Ruby on Rails application with Postgres as your database, you might have the following dependencies other than the ones that you have defined in the Gemfile, which might be Nodejs, yarn, logrotate, build-essential, Nginx, cron, libpq-dev. For instance, let’s say you have installed all the application dependencies required for the application except for nodejs or you have installed a different version of the nodejs from the one that is intended to be used in this project. In this case, your application is not guaranteed to work as expected in your system. We call this the “inconsistent environment” issue. We can use docker to manage all our application dependencies and avoid all these unwanted hassles and improve our productivity. This is a major benefit of using docker could bring to our application development.

Isolation:
Let’s say. you are working on 2 different projects and both of these projects require different versions of PHP, you have to switch between 2 different PHP versions every single time you are switching projects. Docker solves this problem with its core technology called containerization which isolates the application from one another even though they are running on the same machine. For example, with your current workflow, you cannot run 2 different Ruby or PHP version applications simultaneously, with docker you can run any number of applications with varying ruby and PHP versions concurrently.

Speed:
With Docker for development, the initial setup needed to run your application is drastically minimized from days to minutes and the only thing that you have to do is to install Docker on your machine and run some commands.

What are docker and docker containers?
Just imagine a container to be a box, in which we put all the application dependencies and run our servers in it. Docker is just a tool that gives us functionalities to create, manage, and interact with these containers.
Another important tool that goes hand-in-hand with docker is docker-compose. Docker-Compose is a tool that lets us create a connection between containers. Since docker containers are isolated due to containerization, they won’t be able to interact with each other. In order for them to interact, we can use the docker-compose tool which creates a network between containers and enables them to interact between them.

How we can use docker to improve our development workflow?
As already said, with a consistent development environment we can all work together as a team without worrying about the underlying application dependencies and avoid unwanted issues. With Docker, the initial setup required for the project will take only a few minutes and we can concentrate on the application development rather than spending days configuring the initial setup for a project. Through Docker’s isolation between containers, now we can work on two different projects at a time without switching between versions back and forth.
What Are Some of the Barriers to Docker Usage?
The biggest barrier is the current knowledge base. Some developers might not fully understand the Docker’s utility or simplicity and might think it’s more complicated than really it is. They may also have other tools,  such as Vagrant (a local virtualization technology), virtual servers, etc.
Along those lines, the time needed for hands-on experimentation can be hard to come by. Designers frequently don’t have the accessible time or transfer speed to designate designing cycles to a genuinely new thing, particularly when they as of now have a working solution. Naturally, they would prefer to invest time fostering their product.
What’s more, it takes a brain shift to translate an ongoing development solution into a Dockerized development solution
Docker Actually Isn’t Difficult to Use — And It’s Worth It

At the point when you have your application in a Docker container, you should rest assured that the code you’re trying locally is the very same build artifact that goes into production. There are no progressions in application runtime conditions. That makes Docker an uncommon tool as far as possible from advancement through creation.What docker provides us is the confidence, that it will do the same thing each time you run it — no matter where you run it.
And, fortunately, Docker isn’t too hard to learn. It’s easy to play with, and the learning curve is relatively small.
So why might it seem hard to use? Probably because you haven’t had the chance to try it yet.

Abishek AS

Devops Engineer

Mallow Technologies Pvt Ltd.

Leave a Comment

Your email address will not be published. Required fields are marked *