文档中心 > Windows实用技巧 > Windows Docker安装

Windows Docker安装

最近更新时间:2021-09-24 04:29:46

win7win8系统

win7win8等需要利用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

1、安装Toolbox

最新版Toolbox下载地址: 访问https://www.docker.com/get-started,注册一个账号,然后登录。

点击Get started with Docker Desktop,并下载Windows的版本,如果你还没有登录,会要求注册登录:

2、运行安装文件

双击下载的Docker for Windows Installer安装文件,一路Next,点击Finish完成安装。

安装完成后,Docker会自动启动。通知栏上会出现个小鲸鱼的图标,这表示Docker正在运行。

桌边也会出现三个图标,入下图所示:

我们可以在命令行执行docker version来查看版本号,docker run hello-world来载入测试镜像测试。

如果没启动,你可以在Windows搜索Docker来启动:

启动后,也可以在通知栏上看到小鲸鱼图标:

镜像加速

Windows 10

对于使用Windows 10的系统,在系统右下角托盘Docker图标内右键菜单选择Settings,打开配置窗口后左侧导航菜单选择Daemon。在Registrymirrors一栏中填写加速器地址https://registry.docker-cn.com,之后点击Apply保存后Docker就会重启并应用配置的镜像地址了。

如果您的问题还未解决,可以提交工单寻求帮助。

免费试用30+款云服务产品 即刻开始您的上云之旅
免费试用
Baidu
map