Docker for windows 安装教程

@TOChtml

Doccker 简介

  Docker 是一个开源的应用容器引擎,基于 Go 语言 并听从 Apache2.0 协议开源。docker

  Docker 可让开发者打包他们的应用以及依赖包到一个轻量级、可移植的容器中,而后发布到任何流行的 Linux 机器上,也能够实现虚拟化。容器是彻底使用沙箱机制,相互之间不会有任何接口(相似 iPhone 的 app),更重要的是容器性能开销极低。shell

  Docker 从 17.03 版本以后分为 CE(Community Edition: 社区版) 和 EE(Enterprise Edition: 企业版),咱们用社区版就能够了。ubuntu

Docker 安装

win七、win8 等须要利用 docker toolbox 来安装,国内可使用阿里云的镜像来下载,下载地址:http://mirrors.aliyun.com/docker-toolbox/windows/docker-toolbox/windows

安装比较简单,双击运行,点下一步便可,能够勾选本身须要的组件:
在这里插入图片描述
docker toolbox 是一个工具集,它主要包含如下一些内容:bash

  • 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 终端。app

若是系统显示 User Account Control 窗口来运行 VirtualBox 修改你的电脑,选择 Yes。
在这里插入图片描述
$ 符号那你能够输入如下命令来执行。ide

$ 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
在这里插入图片描述
一、安装 Toolbox
最新版 Toolbox 下载地址: 访问 https://www.docker.com/get-started,注册一个帐号,而后登陆性能

点击 Get started with Docker Desktop,并下载 Windows 的版本,若是你尚未登陆,会要求注册登陆:
在这里插入图片描述
在这里插入图片描述
二、运行安装文件
双击下载的 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 就会重启并应用配置的镜像地址了。
在这里插入图片描述

参考文献:https://www.runoob.com/docker/windows-docker-install.html

相关文章
相关标签/搜索