Docker Tutorial
Docker Installation
How to use Docker
Docker Instance
Docker Container Lifecycle Command
Docker Container Operation Command
Docker Container rootfs Command
Docker Mirror Repository Command
Docker Local Image Management Command
Docker info|version Command
Docker is not a general-purpose container tool, it relies on an existing and running Linux kernel environment.
Docker essentially creates an isolated file environment under the already running Linux, so it performs almost as efficiently as the deployed Linux host.
Therefore, Docker must be deployed on a system with a Linux kernel. If other systems want to deploy Docker, they must install a virtual Linux environment.
The way to deploy Docker on Windows is to install a virtual machine first, and run Docker in the virtual machine installed with Linux system.
Docker Desktop is the official installation method of Docker on Windows 10 and macOS operating systems. This method still belongs to the method of installing Linux in a virtual machine first and then installing Docker.
Docker Desktop official download address: https://hub.docker.com/editions/community/docker-ce-desktop-windows
Note: This method is only available for Windows 10 OS Professional, Enterprise, Education and some Home editions!
Hyper-V is a virtual machine developed by Microsoft, similar to VMWare or VirtualBox, for Windows 10 only. This is the virtual machine used by Docker Desktop for Windows.
However, once this virtual machine is enabled, QEMU, VirtualBox or VMWare Workstation 15 and below will not work! If you must use another virtual machine on your computer (such as an emulator that must be used to develop Android apps), don't use Hyper-V!
Go to https://hub.docker.com/?overlay=onboarding, and download the Windows version, if you haven't logged in, you will be asked to log in:
Double-click the downloaded Docker for Windows Installer installation file, go all the way to Next, and click Finish to complete the installation.
After the installation is complete, Docker will start automatically. A small whale icon will appear on the notification bar , which means Docker is running.
Three icons will also appear on the desktop, as shown below:
We can execute docker version on the command line to view the version number, and docker run hello-world to load the test image test.
If it doesn't start, you can search for Docker on Windows to start it:
After startup, you can also see the little whale icon on the notification bar:
If you encounter errors during startup due to WSL 2, install WSL 2.
After installation, you can open PowerShell and run the following command to check if it ran successfully:
docker run hello-world
Win7, win8, etc. need to use docker toolbox to install.
The installation is relatively simple, double-click to run, click Next, you can check the components you need:
docker toolbox is a toolset that mainly includes the following:
After the download is complete, click Install directly. After the installation is successful, three icons will appear on the desktop, as shown in the following figure:
Click the Docker QuickStart icon to launch the Docker Toolbox terminal.
If the User Account Control window is displayed to run VirtualBox to modify your computer, select Yes.
$
You can enter the following command to execute it.
$ docker run hello-world Unable to find image 'hello-world:latest' locally Pulling repository hello-world 91c95931e552: Download complete a8219747be10: Download complete Status: Downloaded newer image for hello-world:latest Hello from Docker. This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker Engine CLI client contacted the Docker Engine daemon. 2. The Docker Engine daemon pulled the "hello-world" image from the Docker Hub. (Assuming it was not already locally available.) 3. The Docker Engine daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker Engine daemon streamed that output to the Docker Engine CLI client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash For more examples and ideas, visit: https://docs.docker.com/userguide/