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
  • Privacy Guides is a non-profit project aimed at providing users with insights into privacy rights, while also recommending best practices or tools to help reclaim privacy in the world of the Internet.

    There are many great articles here, and I will take the example of three concepts that are often confused or misrepresented: Privacy, Security, and Anonymity. While many people who oppose privacy argue that a person does not need privacy if they have 'nothing to hide.' 'This is a dangerous misconception, as it creates the impression that those who demand privacy must be deviant, criminal, or wrongdoers.' - Why Privacy Matters.

    » Read more
  • There is a wonderful place to learn, or if you're stuck in the thought that there's nothing left to learn, then the comments over at Hacker News are just for you.

    Y Combinator - the company behind Hacker News focuses on venture capital investments for startups in Silicon Valley, so it’s no surprise that there are many brilliant minds commenting here. But their casual discussions provide us with keywords that can open up many new insights.

    Don't believe it? Just scroll a bit, click on a post that matches your interests, check out the comments, and don’t forget to grab a cup of coffee next to you ☕️

    » Read more
  • Just got played by my buddy Turso. The server suddenly crashed, and checking the logs revealed a lot of errors:

    Operation was blocked LibsqlError: PROXY_ERROR: error executing a request on the primary

    Suspicious, I went to the Turso admin panel and saw the statistics showing that I had executed over 500 million write commands!? At that moment, I was like, "What the heck? Am I being DDoSed? But there's no way I could have written 500 million."

    Turso offers users free monthly limits of 1 billion read requests and 25 million write requests, yet I had written over 500 million. Does that seem unreasonable to everyone? 😆. But the server was down, and should I really spend money to get it back online? Roughly calculating, 500M would cost about $500.

    After that, I went to the Discord channel seeking help, and very quickly someone came in to assist me, and just a few minutes later they informed me that the error was on their side and had restored the service for me. Truly, in the midst of misfortune, there’s good fortune; what I love most about this service is the quick support like this 🙏

    » 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

5 profound lessons

Every product comes with stories. The success of others is an inspiration for many to follow. 5 lessons learned have changed me forever. How about you? Click now!

Every product comes with stories. The success of others is an inspiration for many to follow. 5 lessons learned have changed me forever. How about you? 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ường3 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ống3 years ago
Cảm ơn một bạn fan cứng. Ghé blog thường xuyên nhé!