>>原創(chuàng)文章,歡迎轉(zhuǎn)載。轉(zhuǎn)載請注明:轉(zhuǎn)載自IT人故事會,謝謝!
>>原文鏈接地址:跟我一起學docker(13)–docker Machine的使用
1.什么是DockerMachine?
Docker Machine是一個工具,它可以幫你在虛擬主機安裝docker,并且通過docker-machine 相關(guān)命令控制主機。你可以用docker machine在mac、windows、單位的網(wǎng)絡(luò)、數(shù)據(jù)中心、云提供商(AWS或Digital Ocean)創(chuàng)建docker主機。
通過docker-machinecommands,你能啟動、進入、停止、重啟主機,也可以升級docker,還可以配置docker client。
2.為什么要用Docker Machine?
Docker Machine是當前docker運行在mac或者windows上的唯一方式,并且操作多種不同linux 系統(tǒng)的docker主機的最佳方式。
3.Docker machine之安裝
下載docker-machine 二進制文件
1)Mac Or linux
curl -Lhttps://github.com/docker/machine/releases/download/v0.8.0/docker-machine-`uname\ -s`-`uname -m` > /usr/local/bin/docker-machine \ && chmod +x/usr/local/bin/docker-machine
2) Windows with git bash
if [[ ! -d"$HOME/bin" ]]; then mkdir -p "$HOME/bin"; fi && \curl -Lhttps://github.com/docker/machine/releases/download/v0.7.0/docker-machine-Windows-x86_64.exe\ "$HOME/bin/docker-machine.exe" && \ chmod +x"$HOME/bin/docker-machine.exe”
黑魔法(離線安裝):
下載地址:https://github.com/docker/machine/releases/
老鐵,我沒使用在線安裝,真心太慢了,我換了手機的4G流量還是遲遲下載不下來,為了下載他我還開通了迅雷會員了用了10年了都沒開通這個會員花了我30,日。
使用離線安裝,啟動迅雷下載
直接在csdn下載把
https://download.csdn.net/download/zhugeaming2018/10404327
4.Docker machine之使用(macor windows)
使用準備:
安裝最新版的virtualbox(https://www.virtualbox.org/wiki/Downloads)
cd ?/etc/yum.repos.d
wget?http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
yum install -y ?VirtualBox-5.2
1 Create a machine
docker-machine create --driver virtualbox default
在上面你會發(fā)現(xiàn)這么句話“errorin driver during machine creation:This computer doesn’t have VT-X/AMD-v enabled.Enabling it in the BIOS is mandatory”意思就是說你的虛擬機沒有打開

2 Get the environmentcommands for your new VM
docker-machine env default
3 List available machinesagain to see your newly minted machine
docker-machine ls
4 Connect your shedocker-machinessh defaultll to the new machine
docker-machine ssh default


5 Start and stop machines
docker-machine stop default
docker-machine start default
5.Docker machine之使用(Iaas)
驅(qū)動支持:
往期docker學習:
