Last update at :2024-05-18,Edit by888u
Docker is not a general container tool. It relies on an existing and running Linux kernel environment.
Docker essentially creates an isolated file environment under an already running Linux, so its execution efficiency is almost the same as that of the deployed Linux host.
Therefore, Docker must be deployed on a Linux kernel system. If you want to deploy Docker on other systems, you must install a virtual Linux environment.
The method of deploying Docker on Windows is to first install a virtual machine and run Docker in the virtual machine where the Linux system is installed.
Win10 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 first installing Linux in the virtual machine and then installing Docker.
Docker Desktop official download address: https://hub.docker.com/editions/community/docker-ce-desktop-windows
Note:This method only works on Windows 10 Pro, Enterprise, Education and some Home editions of the operating system!
Install Hyper-V
Hyper-V is a virtual machine developed by Microsoft, similar to VMWare or VirtualBox, that only works with Windows 10. 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 necessary to develop Android apps), don't use Hyper-V!
Enable Hyper-V
Programs and features
Turn Windows features on or off
Select Hyper-V
Hyper-V can also be enabled through commands. Please right-click the start menu and run PowerShell as an administrator, and execute the following command:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Install Docker Desktop for Windows
Click Get started with Docker Desktop and download the Windows version. If you have not logged in yet, you will be asked to register and log in:
Run the installation file
Double-click the downloaded Docker for Windows Installer installation file, click 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, indicating that 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 for testing.
If it does not start, you can search for Docker in Windows to start it:
After startup, you can also see the little whale icon on the notification bar:
If you encounter errors caused by WSL 2 during startup, please install WSL 2.
After installation, you can open PowerShell and run the following command to check whether it runs successfully:
docker run hello-world
The following message should appear after a successful run:
win7, win8 system
win7, win8, etc. need to be installed using docker toolbox. Mainland China can use the Alibaba Cloud mirror to download. Download address: http://mirrors.aliyun.com/docker-toolbox/windows/docker-toolbox/
The installation is relatively simple, just double-click to run and click Next. You can check the components you need:
Docker toolbox is a toolset that mainly includes the following contents:
- Docker CLI – client, used to run the docker engine to create images and containers.
- Docker Machine – allows you to run docker engine commands from the Windows command line.
- Docker Compose – used to run the docker-compose command.
- Kitematic – This is the GUI version of Docker.
- Docker QuickStart shell – This is a command line environment that has Docker configured.
- Oracle VM Virtualbox – virtual machine.
After the download is completed, click Install directly. After the installation is successful, three icons will appear on the desktop, as shown in the figure below:
Click the Docker QuickStart icon to launch the Docker Toolbox terminal.
If the User Account Control window appears to run VirtualBox to modify your computer, select Yes.
$ symbol, you can enter the following command to execute.
$ 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/
Recommended site searches: Korean cn2 server, dual-line virtual host, mobile server rental, registered domain name server, IP search, server high defense Hong Kong, Korean cn2 server, 1g American virtual host, java virtual host,
发表评论