这个其实没什么好说的,我就是为了记录一下建立的过程,若是不会使用docker-machine,在个人博客里你搜索一下就有我写的教程了,那个是关于用docker-machine在阿里云里建立安装有docker的虚拟机的docker
首先你要安装好docker-machine,这个就不说了,以后就是docker-machine使用vmwarevsphere的驱动,因此若是你是单台esxi主机的话,那就要先安装vsphere了,以后就是建立安装有docker的虚拟机了,命令很简单,最基础的就是下面这些bash
docker-machine create -d vmwarevsphere --vmwarevsphere-password="Yuncan1803;" --vmwarevsphere-vcenter=192.168.0.94 --vmwarevsphere-username="administrator@vsphere.local" docker
网络
-d后面加的就是使用的驱动名字,咱们使用的是vmwarevsphere,--vmwarevsphere-password后面指定的就是vsphere主机的密码,--vmwarevsphere-vcenter后指定的是vsphere的ip或者域名,--vmwarevsphere-username后面就是vsphere的用户名,最后的docker就是主机的名字,这些参数是必须的,若是你想定制,好比建立的虚拟机的内存磁盘大小等等,下面是全部的参数ssh
--vmwarevsphere-boot2docker-url
boot2docker的地址--vmwarevsphere-cpu-count
建立的虚拟机的cpu个数--vmwarevsphere-datacenter
虚拟机所在的数据中心--vmwarevsphere-datastore
虚拟机所使用的数据存储--vmwarevsphere-disk-size
虚拟机所使用的磁盘大小单位是MB--vmwarevsphere-folder
虚拟机所在的文件夹名字--vmwarevsphere-hostsystem
虚拟机的主机名--vmwarevsphere-memory-size
虚拟机的内存大小单位是MB--vmwarevsphere-network
虚拟机使用的网络--vmwarevsphere-password
vsphere的密码--vmwarevsphere-pool
虚拟机的资源池--vmwarevsphere-username
vsphere的用户名--vmwarevsphere-vcenter-port
vcenter的端口--vmwarevsphere-vcenter
vcenter的ip地址或者域名注意加完上面的参数以后最后必定要加上虚拟机的名字 建立过程具体以下ui
➜ ~ docker-machine create -d vmwarevsphere --vmwarevsphere-password="Yuncan1803;" --vmwarevsphere-vcenter=192.168.0.94 --vmwarevsphere-username="administrator@vsphere.local" docker2 Running pre-create checks... Creating machine... (docker2) Copying /home/bboysoul/.docker/machine/cache/boot2docker.iso to /home/bboysoul/.docker/machine/machines/docker2/boot2docker.iso... (docker2) Generating SSH Keypair... (docker2) Creating VM... (docker2) Uploading Boot2docker ISO ... (docker2) adding network: VM Network (docker2) Reconfiguring VM (docker2) Waiting for VMware Tools to come online... (docker2) Provisioning certs and ssh keys... 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 docker2
接着你能够ssh进去this
➜ ~ docker-machine ssh docker2 ## . ## ## ## == ## ## ## ## ## === /"""""""""""""""""\___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~ \______ o __/ \ \ __/ \____\_______/ _ _ ____ _ _ | |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __ | '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__| | |_) | (_) | (_) | |_ / __/ (_| | (_) | (__| < __/ | |_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_| Boot2Docker version 18.03.0-ce, build HEAD : 404ee40 - Thu Mar 22 17:12:23 UTC 2018 Docker version 18.03.0-ce, build 0520e24 docker@docker2:~$
欢迎关注Bboysoul的博客www.bboysoul.com Have Fun阿里云