Series on Docker in Practice & Production - What Makes Docker So Popular?

Series on Docker in Practice & Production - What Makes Docker So Popular?

Daily short news for you
  • In light of the fact that many people are "panicking" over the possibility of Telegram being banned, I know of an alternative solution, which is signal.org.

    I use Telegram daily, mainly for personal and work communication. At first, I used it because it was simple, fast, and supported multiple platforms. In the past 1-2 years, Telegram has been adding many new features, making it no longer as straightforward as it used to be.

    Signal is a nonprofit organization; the Signal app does not track, does not have ads, and they even open-source it. Just give it a try 🤓

    » Read more
  • Just as I was about to go to sleep, I saw the news that claude has released Claude 4. As usual, all the superlatives are piling up on this one, like the best code writing, the best reasoning... 🤔

    Now we just have to wait for Cursor to update because I'm still using 3.5 since 3.7 takes too long and just goes on about nothing. Or maybe the tasks assigned to it aren't challenging enough, so it's sluggish 😆. Let's see what this 4 has in store!

    » Read more
  • At the beginning of the month, I mentioned being hit by a DDoS attack and an Injection attack, with the main IPs coming from Russia. Yesterday, while reviewing backlinks, I found a Russian article linking to the post I'm Under DDoS Attack. A slight coincidence or did the DDoS author test to see if it would crash first before posting? 😆

    » Read more

Issue

In recent years, the name Docker has been shaking up the programming world. Everyone is using Docker, from developers to non-developers.

Remember a few years ago when I was still tinkering with my laptop. I had a passion for installing Windows, reinstalling it several times a month. Sometimes I installed Windows, other times Ubuntu. Each time, I had to set up the development environment on my machine, whether it was MySQL server or PostgreSQL, MongoDB...

But installing these things on Windows was tiring. I had to go to different websites to download and install them, which took a lot of time. Overall, setting up the environment I needed at that time could take an entire half-day or even longer.

However, Ubuntu made things easier. Ubuntu only required a simple and quick command to install. That's why I started to prefer Ubuntu as my main development environment.

At that time, I hadn't heard of Docker yet. I only heard about it briefly, but I didn't have a need to dig deeper until I was assigned to a project that required working with Docker to build images for deployment. It was then that I truly began to explore what Docker was and what benefits it could bring.

At first, I searched for articles about Docker in Vietnamese, but I was still not satisfied with the answers to my questions. There were too many concepts to remember, such as images, containers, registries... There were so many things that I didn't understand their functions.

So I decided to make time to read the documentation on the Docker website. I recommend that you, especially those who are new to Docker, take the time to read the Docker documentation during or after reading this series. This series simply summarizes the basic knowledge and provides guidance for those who want to learn about Docker. Therefore, it is not possible to cover all the knowledge about Docker in this series.

The "Docker in Practice & Production" series is expected to include 5 articles, starting from an introduction to how to deploy a product in production. In terms of knowledge, I hope that after the series, you will have a basic understanding of Docker, its components, how to use it, and how to deploy applications.

Again, I don't claim to understand everything about Docker. The knowledge I am about to share with you is what I have learned during my learning and work experience with Docker. I look forward to receiving feedback from you.

What is Docker?

Let me quote an English excerpt from Docker's documentation:

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production.

Simply put, Docker is a platform that allows you to package and run applications in an environment called a container.

Applications here can be popular platforms like MySQL server, MongoDB... With Docker, you can easily create a MySQL server, a MongoDB server, and what's special is that you can run multiple of them at the same time.

Docker Architecture

Docker Architecture

Docker uses a client-server architecture, in which the Docker daemon acts as the server and processes client requests. The client can be dockerd, which allows sending common commands like build, run, pull... to the Docker daemon for processing. To understand the components in Docker's architecture more clearly, you can read more here.

The Docker daemon manages the basic components in Docker such as Container, Image, Network, allowing them to work together. In addition, there is the Registry which serves as a storage location for Docker Images (think of the Registry as a git Repository).

Benefits of Using Docker

Naturally, the more benefits it brings, the more users it attracts. Using Docker brings many benefits, such as:

Rapid and consistent application distribution.

Docker supports CI/CD very well. The tasks we need to do to develop and release a product, including creating an image, launching the image with a container, and a series of automated or manual testing commands, can all be set up to run automatically.

Packaging applications into a single image also reduces the need to install many dependencies when running an application that someone shares with you. For example, if you want to run a program coded in Python by a colleague on your machine, while you are a Node.js developer and have not installed Python, you need to install Python, right? But with Docker, your colleague only needs to build an image that can run that program and give it to you. You only need one command to start that image quickly, minimizing the chance of errors that may occur during the Python installation process.

Quick and easy deployment and scalability.

Docker allows you to deploy applications using a single command or a set of commands in a .yaml file.

Imagine that every time you need to set up a working environment on a new machine, with Docker, this setup process is quite easy if you have created your own .yaml files beforehand.

Docker also provides something called Docker Swarm, which allows us to easily scale our application deployment. Imagine if the Docker server on your machine runs out of memory or CPU, you can join another Docker server to the cluster to scale them.

Running multiple applications simultaneously on a single hardware.

Containers in Docker are lightweight, much lighter than using virtual machines, so you can run more applications at the same time.

Conclusion

Docker is a platform that allows you to package and run applications in containers. Understanding and utilizing Docker will bring great benefits, whether you are a frontend developer or a backend developer. In the next part, I will discuss the basic components of Docker and their uses. Make sure to follow the blog regularly.

Premium
Hello

The secret stack of Blog

As a developer, are you curious about the technology secrets or the technical debts of this blog? All secrets will be revealed in the article below. What are you waiting for, click now!

As a developer, are you curious about the technology secrets or the technical debts of this blog? All secrets will be revealed in the article below. What are you waiting for, click now!

View all

Subscribe to receive new article notifications

or
* The summary newsletter is sent every 1-2 weeks, cancel anytime.

Comments (1)

Leave a comment...
Avatar
Trịnh Cường4 years ago

Mình rất thích cách giải thích và diễn giải của bạn. dự án của mình cũng đang áp dụng docker.rất bổ ích và thú vị. ra phần tiếp theo nhanh nhé bạn :)).

Reply
Avatar
Xuân Hoài Tống4 years ago

Cảm ơn một bạn fan cứng. Ghé blog thường xuyên nhé!