Mac OS X用戶使用Docker Toolbox安裝Docker軟件, Docker Toolbox包含了下列的Docker 工具:
由于Docker Engine守護進程使用特定的Linux內核的功能, 你無法再本地的OS X運行Docker Engine, 與之代替的是你必須使用Docker Machine命令docker-machine在你本地的機器創建并連接一個小型的linux虛擬機. 這個就在你Mac上的虛擬主機就是Docker Machine.
第一步,檢查版本
你的Mac必須運行OS X 10.8 “Mountain Lion”或以上的系統才能運行Docker, 你可以這樣查看OS的版本:
1、從蘋果菜單中選擇”關于本機”
2、如果你的版本正確,就可以進行下一步了
如果你沒有使用支持的版本,你需要考慮先升級的你操作系統
第二步,安裝Docker Toolbox
1、訪問Docker Toolbox
2、點擊下載鏈接
3、通過雙擊下載的安裝包, 或者右鍵安裝包在彈出的菜單中選擇”打開”, 來安裝Docker Toolbox
安裝程序將啟動一個介紹對話框,介紹安裝內容的概述。
4、點擊”繼續”安裝toolbox
安裝程序為你提供了選項, 自定義標準安裝
默認的, 標準的Docker Toolbox安裝:
現階段, 不要修改任何的默認選線
5、點擊”安裝”, 執行標準安裝
系統會提示你輸入密碼
輸入你的密碼, 繼續完成安裝
當它完成后,安裝程序提供了一些快捷鍵。您可以忽略此為現在和點擊繼續。
點擊”關閉”結束安裝
第三步, 驗證安裝
為了運行一個Docker容器, 你需要:
一旦你創建了Docker machine, 你可以想任何一個Virtual Box VM一樣隨時使用它, 它會保持你使用后的相關配置.
1、打開Launchpad, 找到Docker Quickstart Terminal圖標
2、點擊Docker Quickstart Terminal圖標, 打開一個窗口.
終端會做一系列的事情來為你設置Docker Quickstart Terminal
Last login: Sat Jul 11 20:09:45 on ttys002bash '/Applications/Docker Quickstart Terminal.app/Contents/Resources/scripts/start.sh'Get http:///var/run/docker.sock/v1.19/images/json?all=1&filters=%7B%22dangling%22%3A%5B%22true%22%5D%7D: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?Get http:///var/run/docker.sock/v1.19/images/json?all=1: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?-bash: lolcat: command not foundmary at meepers in ~$ bash '/Applications/Docker Quickstart Terminal.app/Contents/Resources/scripts/start.sh'Creating Machine dev...Creating VirtualBox VM...Creating SSH key...Starting VirtualBox VM...Starting VM...To see how to connect Docker to this machine, run: docker-machine env devStarting machine dev...Setting environment variables for machine dev... ## . ## ## ## == ## ## ## ## ## === /"""""""""""""""""/___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~ /______ o __/ / / __/ /____/_______/The Docker Quick Start Terminal is configured to use Docker with the “default” VM.
3、在終端窗口上點擊鼠標用來激活
如果你不熟悉終端窗口,這里有一些快速提示。
該提示是傳統的$美元符號。你輸入命令在命令行這是提示后的區域。您的光標被突出顯示的區域或指示|出現在命令行。鍵入命令后,一直按回車鍵。
4、鍵入命令docker run hello-world然后按回車鍵
該命令為你做了一些工作,如果一切運行良好,則該命令的輸出如下所示:
$ docker run hello-worldUnable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-world535020c3e8ad: Pull completeaf340544ed62: Pull completeDigest: sha256:a68868bfe696c00866942e8f5ca39e3e31b79c1e50feaee4ce5e28df2f051d5cStatus: Downloaded newer image for hello-world:latestHello from Docker.This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps:1. The Docker Engine CLI client contacted the Docker Engine daemon.2. The Docker Engine daemon pulled the "hello-world" image from the Docker Hub.3. The Docker Engine daemon created a new container from that image which runs the executable that produces the output you are currently reading.4. The Docker Engine daemon streamed that output to the Docker Engine CLI client, which sent it to your terminal.To try something more ambitious, you can run an Ubuntu container with:$ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker Hub account:https://hub.docker.comFor more examples and ideas, visit:https://docs.docker.com/userguide/
尋找故障排除幫助?
通常情況下,上述步驟工作外的開箱,但某些情況下可能會出現問題。如果你的Docker運行的hello-world沒有工作,出現了錯誤,請查看故障排除快速修復常見問題。
下一步去哪里?
此時, 您已成功安裝了Docker軟件. 離開Docker Quickstart Terminal窗口. 現在, 進入下一個頁面, 閱讀一個非常簡短的介紹, [Docker鏡像和容器]
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持VEVB武林網。
新聞熱點
疑難解答
圖片精選