I have been a full-stack developer most of my programming life, and I wanted to change that and expand my horizons. So, I started learning Docker. It's been almost a week since the start! Here's what I have learned so far:
Reflecting on Past Learnings
Honestly, I already shared my first learnings in a LinkedIn post. But it felt like too much text for LinkedIn, so I switched to Hashnode. I'm really enjoying Hashnode; everything is so clean! Anyway, to summarize, my initial learnings were about Docker basics and were quite theoretical. I learned about containers, images, Docker architecture, the daemon, the client, and the registry.
So, what's new?
Since then, I have learned a lot of new, more practical things. This includes building images and running containers. I also studied images and containers more deeply. I used the CLI for these tasks because I prefer it, but Docker Desktop also seemed pretty neat. Let's dive into my recent learnings.
Containers - learning more about them and actually running some!
Since my early days, I have learned more about containers and have managed to create some myself. One topic that really stood out to me was the comparison between containers and virtual machines (VMs). Honestly, I hadn't thought much about their similarities and differences before, but as soon as I read about them, I realized they are quite similar since both achieve virtualization.
The only striking difference between the two is the "scale" of virtualization that both try to achieve. VMs are entire operating systems with their own hardware drivers, kernel, programs, and applications. Whereas, containers achieve a really minimal level of virtualization since they only require it to run a single isolated application.
But let's go to the exciting stuff now. I spinned up some example containers of my own from the Docker guides. Here are some images of my efforts for a not-so-uncommon but still sweet triumph:
It was really fun to quickly spin up a container and look at the terminal doing its thing. There was so much happening, and honestly, I do not really understand a lot of the stuff that is going on. But I am excited to learn about them soon.
Images - something more about the birthplace of containers
Since I learned more about containers, I also had to learn about images. I didn't dive into making and building images and all the detailed stuff, but what I learned is still important. The two most important things I learned about images were that they were immutable and layered.
The immutability aspect comes from the fact that a "built" image cannot be modified but only extended upon. If we had to change anything in the existing image, we would have to rebuild the entire image. Immutability really helps with the stability, security, and consistency of these images. So I found this addition really neat.
What I found even more amazing is the layering system of Docker images. Apparently, each instruction in a Docker image file is its own layer. So, if we need to change anything and rebuild it, Docker only rebuilds the modified layers. This makes the building process much more efficient and optimized.
Conclusion
Well, that was pretty much all I learned and did in the past few days. I am really having fun learning this whole new thing called Docker, which is not programming. I still have a lot to learn, though. In the coming few days, I will probably be learning more about the Docker registry and the Docker Hub. During these few days, I also used some commands related to Docker Compose without really knowing what Docker Compose is. So, that's also on my learning list! I will see you in a few days with some newfound knowledge. Till then, adios!