Windows中安装Docker图文详解

发布于 14 天前 作者 itying888 55 次浏览 最后一次编辑是 14 天前 来自 分享

Windows中安装Docker图文详解: b站学习地址:https://www.bilibili.com/video/BV1LQ4y127qT?p=1 Linux Docker、Swarm、 Kubernetes分布式微服务部署云原生实战全套资料下载地址:https://www.itying.com/goods-1155.html

首先我们要注意:操作系统上面需要启用Hyper-V 和适用Linux的子系统

Hyper-V 是微软开发的虚拟机,类似于 VMWare 或 VirtualBox,仅适用于 Windows 10。这是 Docker Desktop for Windows 所使用的虚拟机。但是,这个虚拟机一旦启用,QEMU、VirtualBox 或 VMWare Workstation 15 及以下版本将无法使用!如果你必须在电脑上使用其他虚拟机(例如开发 Android 应用必须使用的模拟器),请不要使用 Hyper-V! image.png

image.png

1、下载软件包 下载软件包:https://docs.docker.com/engine/install/

image.png

2、安装软件

image.png

image.png

image.png

注意:此方法仅适用于 Windows 10 操作系统专业版、企业版、教育版和部分家庭版!

3、运行软件

如果第一次打开提示下面错误,请下载安装wslupdatex64.mis 后重启docker

image.png

https://docs.microsoft.com/en-us/windows/wsl/install-win10#step-4---download-the-linux-kernel-update-package

image.png

下载wslupdatex64.mis 安装后重启docker

docker info

image.png

4、镜像加速

鉴于国内网络问题,后续拉取 Docker 镜像十分缓慢,我们可以需要配置加速器来解决,我使用的是阿里的镜像地址:https://02xz0m84.mirror.aliyuncs.com 如何创建阿里镜像参考:http://bbs.itying.com/topic/6103bb600ebf8e02588af899 在任务栏点击 Docker for mac 应用图标 -> Perferences… -> Docker Engine

{
  ...
  "registry-mirrors": ["https://02xz0m84.mirror.aliyuncs.com"]
  ...
}

image.png

5、通过运行hello world映像来验证Docker引擎安装是否正确

启动hello-world容器

docker run hello-world
[root[@localhost](/user/localhost) /]# docker run hello-world

Unable to find image 'hello-world:latest' locally

latest: Pulling from library/hello-world

b8dfde127a29: Pull complete 

Digest: sha256:df5f5184104426b65967e016ff2ac0bfcd44ad7899ca3bbcf8e44e4461491a9e

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 client contacted the Docker daemon.

 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.

    (amd64)

 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.



To try something more ambitious, you can run an Ubuntu container with:

 $ docker run -it ubuntu bash



Share images, automate workflows, and more with a free Docker ID:

 https://hub.docker.com/



For more examples and ideas, visit:

 https://docs.docker.com/get-started/
回到顶部