win7、win8
win7、win8 等需要利用 docker toolbox 來安裝,國內可以使用阿里雲的鏡像來下載,下載地址:http://mirrors.aliyun.com/docker-toolbox/windows/docker-toolbox/
docker toolbox 是一個工具集,它主要包含以下一些內容:
Docker CLI 客戶端,用來運行docker引擎創建鏡像和容器
Docker Machine. 可以讓你在windows的命令行中運行docker引擎命令
Docker Compose. 用來運行docker-compose命令
Kitematic. 這是Docker的GUI版本
Docker QuickStart shell. 這是一個已經配置好Docker的命令行環境
Oracle VM Virtualbox. 虛擬機
下載完成之後直接點擊安裝,安裝成功後,桌邊會出現三個圖標,入下圖所示:
點擊 Docker QuickStart 圖標來啟動 Docker Toolbox 終端。
如果系統顯示 User Account Control 窗口來運行 VirtualBox 修改你的電腦,選擇 Yes。
$ 符號那你可以輸入以下命令來執行。
$ docker run hello-world Unable to find image 'hello-world:latest' locally Pulling repository hello-world 91c95931e552: Download complete a8219747be10: Download complete Status: Downloaded newer image for hello-world:latest Hello 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. (Assuming it was not already locally available.) 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 bash
For more examples and ideas, visit:
https://docs.docker.com/userguide/
Win10 系統
現在 Docker 有專門的 Win10 專業版系統的安裝包,需要開啟Hyper-V。
開啟 Hyper-V
程序和功能、啟用或關閉Windows功能、選中Hyper-V
安裝 Toolbox
最新版 Toolbox 下載地址: https://www.docker.com/get-docker
點擊 Get Docker Community Edition,並下載 Windows 的版本:
運行安裝文件
雙擊下載的 Docker for Windows Installe 安裝文件,一路 Next,點擊 Finish 完成安裝。
安裝完成後,Docker 會自動啟動。通知欄上會出現個小鯨魚的圖標,這表示 Docker 正在運行。
桌邊也會出現三個圖標,入下圖所示:
我們可以在命令行執行 docker version 來查看版本號,docker run hello-world 來載入測試鏡像測試。
如果沒啟動,你可以在 Windows 搜索 Docker 來啟動:
啟動後,也可以在通知欄上看到小鯨魚圖標:
鏡像加速
鑑於國內網絡問題,後續拉取 Docker 鏡像十分緩慢,我們可以需要配置加速器來解決,我使用的是網易的鏡像地址:http://hub-mirror.c.163.com。
新版的 Docker 使用 /etc/docker/daemon.json(Linux) 或者 %programdata%\docker\config\daemon.json(Windows) 來配置 Daemon。
請在該配置文件中加入(沒有該文件的話,請先建一個):
{ "registry-mirrors": ["http://hub-mirror.c.163.com"]}
讓您學習到的每一節課都有所收穫《Linux就該這麼學》是一本由資深運維專家劉遄老師及國內多名紅帽架構師(RHCA)基於最新RHEL7系統共同編寫的高質量Linux技術自學教程,極其適合用於Linux技術入門教程或講課輔助教材。榮獲雙11、雙12購物狂歡節IT品類書籍銷量冠軍,2017年、2018年國內讀者增速最快的技術書籍,您可以在京東、噹噹、亞馬遜及天貓搜索書名後購買,亦可加劉遄老師微信交流學習(手指按住下圖3秒鐘即可自動掃描)~
劉遄老師QQ:5604215
☀ Linux技術交流群:560843(新群,火熱加群中……)
☀ 官方站點:www.linuxprobe.com
☀ 書籍在線學習(電腦在線閱讀效果更佳):
http://www.linuxprobe.com/chapter-00.html
《Linux就該這麼學》是一本基於最新Linux系統編寫,面向零基礎讀者的技術書籍。從Linux基礎知識講起,然後漸進式地提高內容難度,詳細講解Linux系統中各種服務的工作原理和配置方式,以匹配真實生產環境對運維人員的要求,突顯內容的實用性。想要學習Linux系統的讀者可以點擊"閱讀原文"按鈕了解這本書,同時這本書也適合專業的運維人員閱讀,作為一本非常有參考價值的工具書!