☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
☆ ☆
☆ 解压该压缩文件到D盘(如果解压到其他盘需要修改相关脚本中的盘符,wu_dh为当前系统登录管理员) ☆
☆ ☆
☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
=============================================================================================
= =
= 一、安装VirtualBox =
= =
=============================================================================================
https://www.virtualbox.org/
VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use.
Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers,
it is also the only professional solution that is freely available as Open Source Software
under the terms of the GNU General Public License (GPL) version 2. See "About VirtualBox" for an introduction.
Presently, VirtualBox runs on Windows, Linux, Macintosh, and Solaris hosts
and supports a large number of guest operating systems including but not limited to
Windows (NT 4.0, 2000, XP, Server 2003, Vista, Windows 7, Windows 8, Windows 10), DOS/Windows 3.x,
Linux (2.4, 2.6, 3.x and 4.x), Solaris and OpenSolaris, OS/2, and OpenBSD.
VirtualBox is being actively developed with frequent releases and has an ever growing list of features,
supported guest operating systems and platforms it runs on. VirtualBox is a community effort backed by a dedicated company:
everyone is encouraged to contribute while Oracle ensures the product always meets professional quality criteria.
C:\Users\wu_dh>cd C:\Program Files\Oracle\VirtualBox # 在VirtualBox 6.1里面打开嵌套 VT-x/AMD-V 功能
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe list vms
"win7" {6264dbf1-96bc-4990-a83d-fb515c487f98}
"default" {5431b136-b506-47d7-9f9f-e3077c05c535}
"minikube" {a47f7b51-82ed-4fc7-a771-03c0125e78ba}
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe modifyvm "win7" --nested-hw-virt on
C:\Program Files\Oracle\VirtualBox>
=============================================================================================
= =
= 二、创建Docker虚拟机(D:\vb\docker\docker-machine-create.bat) =
= =
=============================================================================================
D:\vb\docker>docker-machine create --virtualbox-boot2docker-url /D/vb/docker/boot2docker.iso --virtualbox-cpu-count 2 --virtualbox-disk-size 40000 --virtualbox-memory 4096 default
Running pre-create checks...
Creating machine...
(default) Downloading C:\Users\wu_dh\.docker\machine\cache\boot2docker.iso from /D/vb/docker/boot2docker.iso...
Error creating machine: Error in driver during machine creation: open /D/vb/docker/boot2docker.iso: The system cannot find the path specified.
D:\vb\docker>docker-machine.exe ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Error Unknown machine does not exist
D:\vb\docker>docker-machine.exe rm default
About to remove default
WARNING: This action will delete both local reference and remote instance.
Are you sure? (y/n): y
Successfully removed default
D:\vb\docker>copy D:\vb\docker\boot2docker.iso C:\Users\wu_dh\.docker\machine\cache\boot2docker.iso
已复制 1 个文件。
D:\vb\docker>docker-machine create --virtualbox-cpu-count 2 --virtualbox-disk-size 40000 --virtualbox-memory 4096 default # 断网执行,否则会自动去下载最新镜像
Running pre-create checks...
(default) Unable to get the latest Boot2Docker ISO release version: Get https://api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp: lookup api.github.com: no such host
Creating machine...
(default) Copying C:\Users\wu_dh\.docker\machine\cache\boot2docker.iso to C:\Users\wu_dh\.docker\machine\machines\default\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to create a network adapter. Sometimes, such confirmation window is minimized in the taskbar.
(default) Found a new host-only adapter: "VirtualBox Host-Only Ethernet Adapter#2"
(default) Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation window is minimized in the taskbar.
(default) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env node
D:\vb\docker>docker-machine ssh default # dcoker/tcuser
sudo vi /var/lib/boot2docker/profile # 在–label provider=virtualbox的下一行添加镜像加速地址
–registry-mirror https://hub-mirror.c.163.com
exit # ESC, Shift+冒号, wq回车,敲exit退出
D:\vb\docker>docker-machine restart default # 重启虚拟机
D:\vb\docker>docker info # Check Registry Mirrors
=============================================================================================
= =
= 三、解压cache.rar镜像文件到缓存文件夹(C:\Users\wu_dh\.minikube\cache) =
= =
=============================================================================================
$ docker images # 创建Minikube的虚拟机后,ssh登录虚拟机可以看到自动(下载)导入的虚拟机
REPOSITORY TAG IMAGE ID CREATED SIZE
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy v1.19.2 d373dd5a8593 5 weeks ago 118MB
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver v1.19.2 607331163122 5 weeks ago 119MB
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager v1.19.2 8603821e1a7a 5 weeks ago 111MB
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler v1.19.2 2f32d66b884f 5 weeks ago 45.7MB
registry.cn-hangzhou.aliyuncs.com/google_containers/storage-provisioner v3 bad58561c4be 7 weeks ago 29.7MB
registry.cn-hangzhou.aliyuncs.com/google_containers/etcd 3.4.13-0 0369cf4303ff 8 weeks ago 253MB
registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard v2.0.3 503bc4b7440b 4 months ago 225MB
registry.cn-hangzhou.aliyuncs.com/google_containers/coredns 1.7.0