The effect of Docker in the learning process

Tram Ho

Docker is now almost a mandatory knowledge for Dev and Devops brothers, but for IT students in general, it is still quite vague and does not know its practical effects. Today I will share with you guys about Docker, something I wish I knew since I was in school.

1. Docker concept

Docker is a system used to virtualize applications . You may be familiar with Windows virtual machines, Linux virtual machines, Docker is also virtual, but not operating system virtualization, but only virtualizing 1 application. Docker will have no interface, but the actual application will still run in the background.

For example, if you search for the docker image of WordPress and run that image, you will immediately have a wordpress on your machine with default settings. Docker image is now running and is called Docker container, it is a wordpress application virtualization machine, with CPU Ram as usual, but only running wordpress on it.

2. The effect of Docker for students

a. No need to install many confusing things when programming

IT students when programming a project usually install all the necessary libraries of a certain Framework on their computer, then code and run. Not a student, but almost everyone.

There was a time when I had to do a project with Nodejs with my friend. One thing is that I’m anti-all frameworks of JS guys, so when I did it, I was afraid to install it with the whole school, in the end it took a long time and then I had to code in 1 night to finish.

At that time, I just wished or borrowed my friend’s computer to code my module, and then I returned it, I didn’t know there was such a good thing as Docker. The docker guy allows me to build into an image the application I code, with the initial background being another image. So, if I choose the original image as the Nodejs image, then copy my code into it and build it into my image, it will be successful.

Until now, when I want to run a stolen program on the network, I always see if it has a built-in Dockerfile to build the image, if not, I also build it myself to run it and delete it later. All image bases such as Python3, Python2, Java8, Nodejs have all been verified by the great Devs in the world , its environment is set up perfectly, not a pile of dust like on my machine, any app is fine. yes, sometimes installing random libraries overwrites each other.

If I clone the code and build on my machine, I often get errors that I’m missing this and that library, but if I build with docker, almost nothing happens, because its environment is so perfect, I won’t use it later. deleted again, and if build on my machine, the library pile is still in a certain folder I don’t know.

b. Portable, easy to share

You just imagine when you finish programming a product, then want to let your friends run it to see, or want to bring it from your home computer to the work computer. Even if you develop products for the community, now you don’t have money to buy a domain name or rent a server, you will build it into a docker image, then send it to your friends to run.

Everything is very convenient. Docker hub is a free hosting and sharing platform for docker images. You just need to create a nickname with your real name, build an image and post it here, the image will always carry your name.

c. Archive older versions of the project

The Docker guy has one thing to distinguish between different builds, which is the image tag. For example, an image looks like this: hehe/haha:dev-1 is an image of the user hehe, with the image name haha ​​and its tag dev-1. You push this image to Dockerhub, then build another image named hehe/haha:dev-2 , then you will get a different image from the original image, even though the application running on it is still just an application. just use haha. And if you leave the old tag dev-1, when you push it to Dockerhub, it will overwrite the existing one.

I can build into multiple images with different versions of the application, along with bumping the version on github for comparison.


In short, the effect of Docker in learning is very good. If you do a project, then push the code to github and push the image to Dockerhub, you can confidently present the project without having to bring your personal computer. It can be easily shared with everyone and stores all of your work.

3. Docker’s Weakness

These weaknesses are the ones that I personally noticed when working with Docker, you read for reference only, may not be true for everyone.

a. Depends on the system architecture of the machine you use

The most frustrating point of this Docker guy is that it depends on the architecture of the machine used to build the image. If the developer uses Linux to build, the image will only work on the same system, porting to Windows or Mac may be faulty. In addition, chip architecture is also greatly influenced. Build on amd x64 architecture and then bring to the arm chip to run can also fail.

My company grants Mac M1 to work. Many people hear that feeling high, but actually after using it, they realize its inhibition. Mac M1 runs an arm chip, and most Docker images on Dockerhub are build amd64, when running on Mac, 99% of them have chip conflicts.

Moreover, the Deploy environment is all Linux / amd64, so the time to edit it so that it builds without errors also takes a lot of time.

To get around this, the Docker cli has an argument of –platform so that devs can customize the platform for the image, and Docker developers are also developing a buildx command for multi-platform builds.

b. Hard to start

Docker is a vague concept for students who are just starting out as dev. It’s the same for me, because when I went to school, all the projects were done in the state of brothers and sisters, setting up the environment on the computer was still difficult.

All students need is how to complete the project as quickly as possible to write reports and make presentations, while Docker is something that does not support programming, even installation takes time. Because there is no need to learn, students do not pay much attention to it.

c. Docker doesn’t help with data sharing

After building the image, you can only share the information that you have copied into it before.

After dev a web and build an image, you can only save the source code in it. And when you run that image, the web is built and working for a while, all the data generated, for example data pushed into the database, will not be saved to the image.

If you run that image somewhere else, the data will not be saved inside, just the same as the original default. The solution to this problem is to mount the volume, but it still has to run on the same system that stores the data.

d. Difficult programming

To program on Docker is also quite difficult, because it has no interface. So a few good techniques were born to serve programming on remote systems, which are Remote Dev and Remote Debug .

Above is a presentation on the effects and weaknesses of Docker for students in the learning process. These are all my subjective opinions, may not be the same as many docker documents, so readers are encouraged to read for reference purposes.

Share the news now

Source : Viblo