系统环境

windows10 ltsc

安装 Docker

Docker下载

安装完毕后再状态栏可以看到小鲸鱼的图标

Docker Hello World

检查是否正常运行

docker --version
正确输出Docker version 18.09.2, build 6247962 版本号,安装完毕

配置阿里云镜像

右键状态栏小鲸鱼图标–>Settings–>Daemon–>Registy Mirrors 输入 https://你的加速地址.mirror.aliyuncs.com

如何获得阿里云的容器加速地址

  • 登陆阿里云
  • 产品与服务–>容器镜像服务–>镜像中心–>镜像加速器

Settings.png
Registy Mirrors.png

修改默认存放位置

Dockerwindows 下默认存放位置是 C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx 若需要修改的话.可移动到其他盘符

Advanced.png

拉取镜像

docker pull hello-world

运行结果如下

1
2
3
4
5
Using default tag: latest
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:92695bc579f31df7a63da6922075d0666e565ceccad16b59c3374d2cf4e8e50e
Status: Downloaded newer image for hello-world:latest

运行镜像

docker run hello-world

运行结果

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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/

到这里,已经成功运行了第一个docker image