macOS中安裝docker

如官方文檔中所說:
一、點擊進入 boot2docker/osx-installer release頁面。
二、在下載頁面中點擊  Boot2Docker-x.x.x.pkg 來下載 Boot2Docker
三、將Boot2Docker-x.x.x安裝在Application中。
四、啓動boot2Docker虛擬機:
  1. 從application中啓動
  2. 命令行 $ boot2docker init 建立 boot2docker-vm; $ boot2docker start 啓動boot2docker-vm
 
問題:
  1. boot2docker release V1.8.0中包含有virtrueBox 5.0.0版本,此時init時會報錯 Fail to get VM.  ——緣由爲5.0.0版本的VirtureBox與macOS版本(10.12)不兼容,此時卸載安裝boot2docker時捆綁安裝的VirtureBox,從新安裝最新5.1.6版本解決問題
  2. 解決問題1後,執行docker start ,一直 處於 Waiting for VM and Docker daemon to start… 的狀態 ——緣由爲 macOS中啓動boot2docker 必須保證 /etc/hosts 中只有一個localhost而且指向127.0.0.1,因而$ sudo vim /etc/hosts 修改localhost,$ boot2docker delete 刪除boot2docker-vm,從新$ boot2docker init 和 $ boot2docker start 後完成啓動
相關文章
相關標籤/搜索