Windows installs the docker environment and configures the image

Install docker toolbox

click to download

After downloading the installation package, go all the way to the next step as shown in the figure (my installation package virtualBox is a required option, although I have already installed it once). You don’t need to install Git if you have already installed it. Kitematic is a mirror visualization tool, and you don’t need to install it. Check.

Insert image description here

Start Docker Quickstart Terminal

If Git has been installed before, or if it was installed without the default path, there will be a pop-up showing no way to open it. Right-click: Properties -> Shortcut, find the target column, and replace the path before login -i with your Git installation path. Just enter the path of bash.exe. The relative path of bash is generally /Git/bin/bash.exe. Then you can open the docker quick start terminal normally.

Insert image description here

copy image

The DockerToolbox installation file comes with the boot2docker.iso image file, which is located in the installation directory (such as C:\Program Files\Docker Toolbox). Copy this file to the C:\Users\Administrator\.docker\machine\cache directory.

Insert image description here

Change virtual disk location

First stop the default virtual machine, then select: Management->Virtual Media Management, select the virtual disk, and click Copy above:

Insert image description here

Select VMDK, select the creation path of the copy in [New virtual disk to be created] (the default is still in the current folder), then add the newly copied virtual disk to the virtual machine, and delete the previous dick

Insert image description here

Mirror download acceleration

Enter in cmd or docker quick start terminal

docker-machine ssh default

Then configure the mirror address

sudo sed -i "s|EXTRA_ARGS='|EXTRA_ARGS='--registry-mirror=https://docker.mirrors.ustc.edu.cn/ |g" /var/lib/boot2docker/profile
  • HKUST mirror: https://docker.mirrors.ustc.edu.cn/
  • NetEase: https://hub-mirror.c.163.com/
  • Alibaba Cloud: https://<yourID>.mirror.aliyuncs.com
  • Qiniu Cloud Accelerator: https://reg-mirror.qiniu.com

Restart docker

docker-machine restart default

hello world

Open Docker Quickstart Terminal

docker run hello-world

如果报错:This computer doesn’t have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory.

Just execute this line of command:

docker-machine create default --virtualbox-no-vtx-check

Guess you like

Origin blog.csdn.net/m0_46521785/article/details/120395561