這個其實沒什麼好說的,我就是爲了記錄一下建立的過程,若是不會使用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阿里雲