About Docker

About Docker
Logo of Docker

I learnt a little bit about Docker today when I am figuring out how to customize this website.

The first time I heard about Docker is from the TA of my Software Engineering class. I will write about how I installed Docker on my pc and what I got to know on it. (I only leant a little from some article, but I want to record it down).

Docker is a tool used to create, deploy, and run applications using containers.

From my understanding, Docker is just a process used to ensure the running environment on different machines are the same.

For example, If an app is developed firstly by A, if A directly sends the app to B for testing, B needs to recreate the same environment as A to ensure the correctness of testing output. It requires B to put extra efforts before woking on the test.

If we use Docker, A can package the app and ship the package to container held by Docker, and B on the other side can rechieve the package and directly head to the test, because Docker can set up the same environment for B! Even if A and B have different OS, Docker can still handle the situation.

Docker is a light Virtual Machine, but it does not create the entire virtual operating system as Virtual Machine does. As a result, Docker is fast in start, requires fewer resources, and very efficient compared to VM.


Install Docker on WSL 2

Get started with Docker containers on WSL
Learn how to set up Docker containers on the Windows Subsystem for Linux.

I followed this offical document to install Docker on WSL of my PC.

Basically, we need to dowload Docker Desktop, and add extensions in VS Code. There is a simple instance provided in this document.

Here are some useful demands:

List the commands available in the Docker CLI by entering: docker
List information for a specific command with: docker <COMMAND> --help
List the docker images on your machine (which is just the hello-world image at this point), with: docker image ls --all
List the containers on your machine, with: docker container ls --all or docker ps -a (without the -a show all flag, only running containers will be displayed)
List system-wide information regarding the Docker installation, including statistics and resources (CPU & memory) available to you in the WSL 2 context, with: docker info

Delete the container(s): docker rm + ID of containers(can use docker ps -a to get ID)

【 全干货 】5 分钟带你看懂 Docker !
欢迎大家前往 腾讯云社区,获取更多腾讯海量技术实践干货哦~ 作者丨唐文广:腾讯工程师,负责无线研发部地图测试。 导语:Docker,近两年才流行起来的超轻量级虚拟机,它可以让你轻松完成持续集成、自动交付、自动…

This is a useful article in Chinese, which introduces to basic logic of Docker.


I only know a little about Docker, and it is important to learn from practical use.


2/26/2024


Use Docker on the full-stack project