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