Docker for Windows10

Docker for windows 目前只适用于windows10版本,对10以下的只能使用 Docker Toolbox

本文只讲win10下的安装使用:

1、从这里下载https://www.docker.com/products/docker#/windows Docker for windows10

     下载一定注意要下载完整,最好是校验一下,否则安装可能会出错。

2、在安装之前确保win10已经开启了Hype-v虚拟器。(开启后需要重启)

   

3、开始安装docker,按默认设置安装完成即可。最后在右下角会出现docker的图标,稍等一会,打开cmd输入docker info 命令检查是否安装成功。

4、由于国内网络原因的问题,建议使用国内加速器。这里以阿里云Docker加速器为例说明:

    首先在阿里云注册(https://cr.console.aliyun.com),获取专用加速地址。

  

   在右下角docker图标上右键打开设置对话框,按图填写上面的加速器地址。

 

5、运行hello-world验证:

 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是启开启了虚拟器,如果开启自行百度。开启成功后应该能在任务管理器看到。

猜你喜欢

转载自my.oschina.net/u/915967/blog/835984