没有不值得去解决的问题,也没有不值得去学习的技术!

Install Docker on Windows 10 Home and Configure the Aliyun Image Accelerator

Run the command docker info again. You will see that the registry mirror has been configured successfully

1. The Windows version is Windows 10 Home (Chinese), which does not support Hyper-V, as shown in Figure 1.

Windows 10 Home (Chinese), does not support Hyper-V
Figure 1

2. Open the URL: https://docs.docker.com/docker-for-windows/install/#what-to-know-before-you-install . If your system does not meet the requirements to run Docker for Windows, you can install Docker Toolbox. Docker Toolbox uses Oracle VirtualBox instead of Hyper-V, as shown in Figure 2.

If your system does not meet the requirements to run Docker for Windows, you can install Docker Toolbox. Docker Toolbox uses Oracle VirtualBox instead of Hyper-V
Figure 2

3. Click the Docker Toolbox link to go to: https://docs.docker.com/toolbox/overview/ , as shown in Figure 3.

Click the Docker Toolbox link to go to: https://docs.docker.com/toolbox/overview/
Figure 3

4. Download Toolbox for Windows, as shown in Figure 4.

Download Toolbox for Windows
Figure 4

5. To run Docker, ensure your Windows system supports hardware virtualization technology and that virtualization is enabled. In the Task Manager’s Performance tab, under CPU, virtualization is shown as enabled, as shown in Figure 5.

To run Docker, ensure your Windows system supports hardware virtualization technology and that virtualization is enabled. In the Task Manager's Performance tab, under CPU, virtualization is shown as enabled
Figure 5

6. Since VirtualBox is already installed, you need to check if VirtualBox is running. If it is running, you must close it before running the installer, as shown in Figure 6.

Since VirtualBox is already installed, you need to check if VirtualBox is running. If it is running, you must close it before running the installer
Figure 6

7. Start the installation. When the component selection prompt appears, uncheck VirtualBox. For the remaining steps, simply accept all the default options, as shown in Figure 7.

Start the installation. When the component selection prompt appears, uncheck VirtualBox. For the remaining steps, simply accept all the default options
Figure 7

8. On the desktop, find the Docker QuickStart Terminal icon, as shown in Figure 8.

On the desktop, find the Docker QuickStart Terminal icon
Figure 8

9. Verify your installation by double-clicking the Docker QuickStart icon to launch the pre-configured Docker Toolbox terminal. If the system displays a User Account Control prompt asking to allow VirtualBox to make changes to your computer, select Yes. Initialization will begin, and once complete, the terminal will display a $ prompt, as shown in Figure 9.

Verify your installation by double-clicking the Docker QuickStart icon to launch the pre-configured Docker Toolbox terminal. If the system displays a User Account Control prompt asking to allow VirtualBox to make changes to your computer, select Yes. Initialization will begin, and once complete, the terminal will display a $ prompt
Figure 9

10. Type the docker run hello-world command and press Enter. If everything goes well, the command output will be as follows, as shown in Figure 10.

Type the docker run hello-world command and press Enter. If everything goes well, the command output will be as follows:
Figure 10

11. Open Oracle VM VirtualBox, and you will find a virtual machine named “default” running, as shown in Figure 11.

Open Oracle VM VirtualBox, and you will find a virtual machine named "default" running
Figure 11

12. Accessing Docker Hub from within China can sometimes be difficult. In this case, you can configure a registry mirror. Open the URL: https://github.com/yeasy/docker_practice/blob/master/install/mirror.md , select Aliyun Accelerator, and click the link, as shown in Figure 12.

Accessing Docker Hub from within China can sometimes be difficult. In this case, you can configure a registry mirror
Figure 12

13. Open the Docker Hub mirror site, as shown in Figure 13.

Open the Docker Hub mirror site
Figure 13

14. View the machine’s environment configuration, configure it locally, and access the Docker service through the Docker client. Run the command: docker-machine env default, as shown in Figure 14.

View the machine's environment configuration, configure it locally, and access the Docker service through the Docker client
Figure 14

15. Follow the prompt to run this command to configure your shell. Run the command: eval “$(docker-machine env default)”, as shown in Figure 15.
# Run this command to configure your shell:
# eval $(“C:\Program Files\Docker Toolbox\docker-machine.exe” env default)

Follow the prompt to run this command to configure your shell. Run the command: eval "$(docker-machine env default)"
Figure 15

16. Run the command: docker info, as shown in Figure 16.

Run the command: docker info
Figure 16

17. Log into the machine to modify the configuration. Run the command: docker-machine ssh default, as shown in Figure 17.

Log into the machine to modify the configuration. Run the command: docker-machine ssh default
Figure 17

18. Modify the /var/lib/boot2docker/profile file and add –registry-mirror=<your accelerate address> to EXTRA_ARGS, as shown in Figure 18.

The Docker Toolbox configuration content is referenced from DaoCloud’s documentation: Docker Accelerator (http://guide.daocloud.io/dcs/daocloud-9153151.html#docker-toolbox)

sudo sed -i “s|EXTRA_ARGS=’|EXTRA_ARGS=’–registry-mirror=https://52itiznk.mirror.aliyuncs.com |g” /var/lib/boot2docker/profile

Modify the /var/lib/boot2docker/profile file and add --registry-mirror=<your accelerate address> to EXTRA_ARGS
Figure 18

19. Run the command: cat /var/lib/boot2docker/profile. The modification is successful, as shown in Figure 19.

Run the command: cat /var/lib/boot2docker/profile. The modification is successful
Figure 19

20. Exit and restart the Docker service, as shown in Figure 20.
exit
docker-machine restart default

Exit and restart the Docker service
Figure 20

21. Run the command docker info again. You will see that the registry mirror has been configured successfully, as shown in Figure 21.

Run the command docker info again. You will see that the registry mirror has been configured successfully
Figure 21

22. Check if the accelerator is in effect. Run the command: docker info|grep “Registry Mirrors” -A 1, as shown in Figure 22.

Check if the accelerator is in effect. Run the command: docker info|grep "Registry Mirrors" -A 1
Figure 22

23. Open Kitematic (Alpha) and click use virtualbox, as shown in Figure 23.

Open Kitematic (Alpha) and click use virtualbox
Figure 23

24. Click skip for now, because the registry mirror has already been configured, so there is no need to connect to the official registry, as shown in Figure 24.

Click skip for now, because the registry mirror has already been configured, so there is no need to connect to the official registry
Figure 24

25. Click docker cli to enter the client, as shown in Figure 25.

Click docker cli to enter the client
Figure 25

26. This actually launches Windows PowerShell and enters C:\Program Files\Docker Toolbox>. Running docker commands here is the same as running them in the Docker Quickstart Terminal, so choose according to your preference, as shown in Figure 26.

This actually launches Windows PowerShell and enters C:\Program Files\Docker Toolbox>. Running docker commands here is the same as running them in the Docker Quickstart Terminal, so choose according to your preference
Figure 26

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系