在 Mac OS X 底下安裝 Docker 服務不難,只需要到 Docker Mac 教學網站下載 Docker Toolbox,就可以使用 docker-machine, docker, docker-compose 等指令操作 Docker 服務。本篇提供另外一種工具,讓 Mac 開發者可以快速使用 Docker 服務,就是這套用 Go 語言寫的 dlite 工具。
安裝方式
dlite 提供三種方式安裝
- 直接下載執行檔案 (推薦) (下載連結)
- 直接透過 brew 指令安裝:
brew install dlite - 開發者模式:
git clone 專案,然後下 make dlite 產生執行檔案
請大家直接使用第一種方式安裝即可。
使用方式
安裝 dlite 需要使用到磁碟空間及記憶體,你可以動態指定 memory 使用量,或者是磁碟空間,詳細指令可以透過 dlite install -h 觀看
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| $ sudo dlite install -h
Usage:
dlite [OPTIONS] install [install-OPTIONS]
creates an empty disk image, downloads the os, saves configuration and creates a launchd agent
Help Options:
-h, --help Show this help message
[install command options]
-c, --cpus= number of CPUs to allocate (default: 1)
-d, --disk= size of disk in GiB to create (default: 20)
-m, --memory= amount of memory in GiB to allocate (default: 2)
-s, --ssh-key= path to public ssh key (default: $HOME/.ssh/id_rsa.pub)
-v, --os-version= version of DhyveOS to install
-n, --hostname= hostname to use for vm (default: local.docker)
-S, --share= directory to export from NFS (default: /Users)
|
可以看到指令預設會佔用 20GB 的磁碟使用量及 2GB 的記憶體,所以安裝時可以調整成個人需求大小,安裝請用 root 使用者
[Read More]