What is Docker?

Share

You must have heard the word Docker about a million times by now but have no clue what it is. By the time you finish this Answer, you’ll have a clear idea of what it is and why you hear about it everywhere.

The “why”

It may be best to understand what Docker is by first looking at why it exists in the first place.

I’m sure you’ve heard of the classic long-running “But It Works On My Machine” programming joke. This is the exact problem Docker aims to solve.

There is often a mismatch of project dependencies and their versions between different systems running the code which can lead to unexpected problems. Docker solves this by creating an isolated movable environment.

Isolated means that your code’s dependencies aren’t affected by those already present (or absent) on the system running your code. For example, let’s say you have node 12.0.0. installed globally on your system, but the project your friend gave you to checkout uses node 13.0.0. If your friend “dockerizes” their app before they send it to you, then the app will “ship” with node 13.0.0. and use that regardless of even if you have node installed in your machine or not. Amazing, no?

Movable means that once your friend has “dockerized” their app, they can send this “dockerized” version to anyone, and it will work on their machine! No more need to set up the dependencies for development on each machine every time.

The “what”

Now that you have an idea of why docker exists, let’s move on to the what. I used the word “dockerized” a few times in the last two paragraphs. What does it mean to “dockerize” your app?

To answer that, let me introduce you to containers.

The isolated moveable environmentdiscussed above along with your code is a container. To put it in a little more technical terms, a container is a package of your code and all the dependencies required to run that code. This ensures that if it works on one machine, it works on all machines.

Docker is a tool used to create and manage containers.

Conclusion

Docker exists to simplify the process of creating and managing containers that are simply isolated movable environments that have your code.

Attributions:
  1. undefined by undefined
Copyright ©2024 Educative, Inc. All rights reserved