What is Docker !!!

ยท

3 min read

Hi all, I am starting to learn docker officially step by step, I've used it previously here and there along with docker-compose and kubernetes, etc. but never learned it officially. I am learning it through the course at udemy and some official guides + googling.

This is not a tutorial or cheat sheet, these are my understandings around docker and kubernetes. Feel free to correct them or let me know for improvisations.

Before going to know what exactly is docker, let us first know why it is needed.

What is Docker trying to fix?

A computer is just an empty machine without any specific software installed( there are some basic softwares installed though ), just like a newly created house without any furniture, beds, tv, air-conditioner nothing ( there can be windows, though ๐Ÿ˜œ).

What docker is trying to achieve is to get us free from the endless loop of installing software on the local machines as well as the cloud, I've installed multiple softwares multiple times on my machine and have faced different errors each time ๐Ÿ˜‘.

Now, what if someone says you just need to install docker, and then you can run any other software without actually installing them, see you just go dancing like this ๐Ÿฆš.

What is Docker?

Docker is a collection of projects including hub, client, server, docker desktop, and many others. In short, it is a platform of these services, which you can use to bundle and share packages called Docker Images.

You will be thinking, Oh man, you didn't clearly explain what is docker and now image ( a new word ). But honestly, this is what I felt in the course video too, and had to google a bit. I will learn more about the exact usages going ahead in the course and state them as and when I know ๐Ÿคฆ๐Ÿป.

On a serious note, Docker Images are a bundle of configuration files, binaries, dependencies to run the software. You cannot run a docker image directly as they are immutable. To run a docker image you need something called container ( one more word ), which is similar to a virtual machine that can run on its own. It is not exactly a VM though, the virtualization in container doesn't happen at hardware level, that's why they are so lightweight.

Going ahead the course explains in-depth how a container and image works behind the scenes with some good diagrams, which I cannot copy over here ยฉ๏ธ.

Installation and first steps

The irony here is, for software that is trying to solve installation problems you need to install it first ๐Ÿคท๐Ÿปโ€โ™‚๏ธ.

One can install it from the official website easily, after installation the basic and main command which you will need is how to run an image or more specifically a container.

To run a hello-world image, you first need to have it in the local cache, if you don't, do not worry. There is one hello-world image already there on docker hub ( I've lost the count of words now ;).

So, yeah docker hub is like github for docker images, which serves as a repository for free images for public usage which include some awesome and useful softwares like rails, redis, postgres, and many more.

We just need hello-world image for start, on running docker run hello-world, docker-cli will connect with docker-server on your local machine and as docker-server couldn't find it in local cache which is the case only on very first call or after clear images ( will see this later ), it will download it ( pull it ) from the docker-hub.

For now, I am making a pause here. There is much more to learn, will share more details as I make progress ๐Ÿคž๐Ÿผ.

I hope you enjoyed it.