Docker - Docker for Windows 安装

安装前须知

如果您的系统不符合运行Docker for Windows的要求,则可以安装Docker Toolbox,Docker Toolbox使用Oracle VM VirtualBox而不是Hyper-V。

  • Docker Toolbox和Docker Machine用户必读:适用于Windows的Docker需要运行Microsoft Hyper-V。 如果需要,Docker for Windows安装程序将为您启用Hyper-V,并重新启动计算机。 启用Hyper-V后,Oracle VM VirtualBox将不再工作,但任何Oracle VM VirtualBox VM映像将保留。 使用Docker Machine(包括通常在Toolbox安装期间创建的默认虚拟机)创建的VirtualBox VM将不再启动。 这些虚拟机不能与Docker for Windows并行使用。 但是,您仍然可以使用Docker Machine来管理远程VM。

  • 必须启用虚拟化。 通常,默认情况下启用虚拟化(请注意,这与启用Hyper-V不同)。

  • 目前版本的Docker for Windows在64位Windows 10 Pro,企业和教育(1607周年纪念版,Build 14393或更高版本)上运行。 将来将支持更多版本的Windows 10。

  • 使用Docker for Windows创建的容器和图像在安装的机器上的所有用户帐户之间共享。 这是因为所有Windows帐户都将使用相同的虚拟机来构建和运行容器。 将来,Docker for Windows将更好地隔离用户内容。

  • 嵌套的虚拟化场景,例如在VMWare或Parallels实例上运行Docker for Windows,可能会起作用,但不能保证(即不正式支持)。

Docker for Windows安装包括:安装提供Docker Engine,Docker CLI客户端,Docker Compose,Docker Machine和Kitematic。


Docker for Windows 安装步骤

1、下载安装文件

最新版 Toolbox 下载地址: https://www.docker.com/get-docker

点击 Download Desktop and Take a Tutorial,并下载 Windows 的版本,如果你还没有登录,会要求注册登录:

2、运行安装文件

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

1. Add short to desktop -----添加桌面快捷方式
2. Use Windows containers instead of Linux containers (this can be changed after installation)  -----使用Windows容器而不是Linux容器(安装后可以更改)

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

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

如果您刚刚安装了应用程序,那么您还可以获得一个弹出式窗口的成功消息,并提供后续步骤,并提供此文档的链接。

初始化完成后,从通知区域图标中选择关于Docker,以验证您是否具有最新版本。

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


如果运行时报如下错误

开启 Hyper-V

应用和功能

下拉 > 程序和功能

启用或关闭Windows功能

选中 Hyper-V(Windows 10 虚拟机)确定 > 搜索必要文件 > 重启电脑


Docker for Windows Settings -----Docker设置

https://blog.youkuaiyun.com/HeatDeath/article/details/70432661


Docker for Windows 使用

https://blog.youkuaiyun.com/HeatDeath/article/details/70313905


镜像加速

鉴于国内网络问题,后续拉取 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"]
}
Docker on Windows by Elton Stoneman English | 14 July 2017 | ISBN: 1785281658 | 358 Pages | AZW3/EPUB/MOBI/PDF (conv) | 23.77 MB Key Features Start building applications as Docker images and running containers in a Windows production environment Design and implement distributed applications that run across multiple networked containers Build a full Continuous Deployment pipeline for a .NET Core application running on Windows Book Description Docker has become hugely popular because it offers benefits at all stages of software design and delivery. Until recently, it was impossible to use a Windows Server platform to host the Docker Engine without adding an additional layer of virtualization. Starting with Windows Server 2016, you are able to use Docker on Windows and take advantage to easily build, deploy, and run Windows Containers. From building and running simple images to designing and implementing distributed applications, this book will teach everything you need to know while using Docker on Windows. You will start by installing Docker on different versions of Windows and Windows Server, and run a simple container to verify that the setup is working correctly. You will see how to build Docker images with a Dockerfile for a simple website, and then run it on Windows. Moving on, we'll cover the practical usage of Docker and the tools in the Docker ecosystem, such as Docker Compose, Docker Trusted Registry, and Docker Swarm Mode. Then, you'll be able to apply that knowledge by building a full continuous deployment pipeline for a .NET Core application running on Windows. We'll also dive deep into some of the core features of Docker, such as networking and security. At the end of the book, you'll be guided through a business case that will help you practically implement Docker in a real-world scenario. What you will learn Understand how Docker works, build images, and run containers Run Docker on different versions of Windows, and on the cloud with Azure Des
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Thomas Kant

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值