Docker for Windows10

Docker for windows 目前只適用於windows10版本,對10如下的只能使用 Docker Toolbox docker

本文只講win10下的安裝使用:ubuntu

一、從這裏下載https://www.docker.com/products/docker#/windows Docker for windows10windows

     下載必定注意要下載完整,最好是校驗一下,不然安裝可能會出錯。bash

二、在安裝以前確保win10已經開啓了Hype-v虛擬器。(開啓後須要重啓)網絡

   

三、開始安裝docker,按默認設置安裝完成便可。最後在右下角會出現docker的圖標,稍等一會,打開cmd輸入docker info 命令檢查是否安裝成功。app

四、因爲國內網絡緣由的問題,建議使用國內加速器。這裏以阿里雲Docker加速器爲例說明:this

    首先在阿里雲註冊(https://cr.console.aliyun.com),獲取專用加速地址。阿里雲

  

   在右下角docker圖標上右鍵打開設置對話框,按圖填寫上面的加速器地址。code

 

五、運行hello-world驗證:terminal

docker run hello-world

  若是不出意外將輸出下面的內容:

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 client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.

能夠繼續使用下面的命令驗證(會感受比不使用加速器快不少了):

docker run -it ubuntu bash

正常狀況會進入ubuntu交互界面。

PS C:\Users\jdoe> docker run -it ubuntu bash

Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
5a132a7e7af1: Pull complete
fd2731e4c50c: Pull complete
28a2f68d1120: Pull complete
a3ed95caeb02: Pull complete
Digest: sha256:4e85ebe01d056b43955250bbac22bdb8734271122e3c78d21e55ee235fc6802d
Status: Downloaded newer image for ubuntu:latest

接下來就是本身去探索Docker的世界了,祝歷險愉快!

 

補充:若是docker啓動錯誤,必定要檢查BIOS中CPU是啓開啓了虛擬器,若是開啓自行百度。開啓成功後應該能在任務管理器看到。

相關文章
相關標籤/搜索