From 313bfc0b720c878c85b0ad77bd658e0c6739ddec Mon Sep 17 00:00:00 2001 From: khs1994 Date: Wed, 1 Nov 2017 15:15:12 +0800 Subject: [PATCH 1/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bf36413..b637904 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 0.8.3 -[Docker](http://www.docker.com) 是个划时代的开源项目,它彻底释放了计算虚拟化的威力,极大提高了应用的运行效率,降低了云计算资源供应的成本! 使用 Docker,可以让应用的部署、测试和分发都变得前所未有的高效和轻松! +[Docker](http://www.docker.com) 是个划时代的开源项目,它彻底释放了计算虚拟化的威力,极大提高了应用的运行效率,降低了云计算资源供应的成本!使用 Docker,可以让应用的部署、测试和分发都变得前所未有的高效和轻松! 无论是应用开发者、运维人员、还是其他信息技术从业人员,都有必要认识和掌握 Docker,以在有限的时间内做更多有意义的事。 @@ -13,7 +13,7 @@ * pdf 版本 [下载](https://www.gitbook.com/download/pdf/book/yeasy/docker_practice) * epub 版本 [下载](https://www.gitbook.com/download/epub/book/yeasy/docker_practice) -Docker 自身仍在快速发展中,生态环境也在蓬勃成长。建议初学者使用 Linux 上最新版的 Docker (v17.10.0)进行学习实践。欢迎参与维护项目:[如何贡献](contribute.md)。 +Docker 自身仍在快速发展中,生态环境也在蓬勃成长。建议初学者使用 Linux 上最新版的 Docker (v17.10.0) 进行学习实践。欢迎参与维护项目:[如何贡献](contribute.md)。 * [修订记录](revision.md) * [贡献者名单](https://github.com/yeasy/docker_practice/graphs/contributors) From 1d06af72daae5edb37625f78b4c6bc0c87509da6 Mon Sep 17 00:00:00 2001 From: khs1994 Date: Wed, 1 Nov 2017 15:47:41 +0800 Subject: [PATCH 2/3] Update content AND Use Docker official CN mirror in example --- basic_concept/image.md | 2 +- install/README.md | 2 +- install/debian.md | 2 +- install/mac.md | 6 +++--- install/mirror.md | 17 ++++++++--------- introduction/what.md | 4 ++-- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/basic_concept/image.md b/basic_concept/image.md index 9a1da20..0131922 100644 --- a/basic_concept/image.md +++ b/basic_concept/image.md @@ -1,6 +1,6 @@ ## Docker 镜像 -我们都知道,操作系统分为内核和用户空间。对于 Linux 而言,内核启动后,会挂载 `root` 文件系统为其提供用户空间支持。而 Docker 镜像(Image),就相当于是一个 `root` 文件系统。比如官方镜像 `ubuntu:14.04` 就包含了完整的一套 Ubuntu 14.04 最小系统的 `root` 文件系统。 +我们都知道,操作系统分为内核和用户空间。对于 Linux 而言,内核启动后,会挂载 `root` 文件系统为其提供用户空间支持。而 Docker 镜像(Image),就相当于是一个 `root` 文件系统。比如官方镜像 `ubuntu:17.10` 就包含了完整的一套 Ubuntu 17.10 最小系统的 `root` 文件系统。 Docker 镜像是一个特殊的文件系统,除了提供容器运行时所需的程序、库、资源、配置等文件外,还包含了一些为运行时准备的一些配置参数(如匿名卷、环境变量、用户等)。镜像不包含任何动态数据,其内容在构建之后也不会被改变。 diff --git a/install/README.md b/install/README.md index 4bbfb03..c81c9cb 100644 --- a/install/README.md +++ b/install/README.md @@ -9,7 +9,7 @@ stable 版本 | 每个季度发行 edge 版本 | 每个月发行 当前 Docker CE 版本 | 17.10.0 -同时 Docker 划分为 CE 和 EE。CE 版本即社区版(免费,支持周期三个月),EE 即企业版,强调安全,付费使用。 +同时 Docker 划分为 CE 和 EE。CE 即社区版(免费,支持周期三个月),EE 即企业版,强调安全,付费使用。 Docker CE 每月发布一个 edge 版本 (17.03, 17.04, 17.05...),每三个月发布一个 stable 版本 (17.03, 17.06, 17.09...),Docker EE 和 stable 版本号保持一致,但每个版本提供一年维护。 diff --git a/install/debian.md b/install/debian.md index 94a6014..1e50fff 100644 --- a/install/debian.md +++ b/install/debian.md @@ -126,7 +126,7 @@ $ sudo sh get-docker.sh --mirror Aliyun ```bash $ sudo add-apt-repository \ - "deb [arch=armhf] https://mirrors.ustc.edu.cn/docker-ce/linux/debian \ + "deb [arch=armhf] https://mirrors.ustc.edu.cn/docker-ce/linux/raspbian \ $(lsb_release -cs) \ stable" ``` diff --git a/install/mac.md b/install/mac.md index b67466f..28bb05a 100644 --- a/install/mac.md +++ b/install/mac.md @@ -50,11 +50,11 @@ brew cask install docker ```bash $ docker --version -Docker version 1.12.3, build 6b644ec +Docker version 17.10.0-ce, build f4ffd25 $ docker-compose --version -docker-compose version 1.8.1, build 878cff1 +docker-compose version 1.17.0-rc1, build a0f95af $ docker-machine --version -docker-machine version 0.8.2, build e18a919 +docker-machine version 0.13.0, build 9ba6da9 ``` 如果 `docker version`、`docker info` 都正常的话,可以运行一个 [Nginx 服务器](https://hub.docker.com/_/nginx/): diff --git a/install/mirror.md b/install/mirror.md index 89810c7..d9a099c 100644 --- a/install/mirror.md +++ b/install/mirror.md @@ -1,6 +1,6 @@ ## 镜像加速器 -国内访问 Docker Hub 有时会遇到困难,此时可以配置镜像加速器。Docker官方和国内很多云服务商都提供了加速器服务,例如: +国内访问 Docker Hub 有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了加速器服务,例如: * [Docker 官方提供的中国registry mirror](https://docs.docker.com/registry/recipes/mirror/#use-case-the-china-registry-mirror) * [阿里云加速器](https://cr.console.aliyun.com/#/accelerator) @@ -10,10 +10,10 @@ ### Ubuntu 14.04、Debian 7 Wheezy -对于使用 [upstart](http://upstart.ubuntu.com/) 的系统而言,编辑 `/etc/default/docker` 文件,在其中的 `DOCKER_OPTS` 中添加获得的加速器配置 `--registry-mirror=<加速器地址>`,如: +对于使用 [upstart](http://upstart.ubuntu.com/) 的系统而言,编辑 `/etc/default/docker` 文件,在其中的 `DOCKER_OPTS` 中添加获得的加速器配置: ```bash -DOCKER_OPTS="--registry-mirror=https://jxus37ad.mirror.aliyuncs.com" +DOCKER_OPTS="--registry-mirror=https://registry.docker-cn.com" ``` 重新启动服务。 @@ -29,7 +29,7 @@ $ sudo service docker restart ```json { "registry-mirrors": [ - "https://sr5arhkn.mirror.aliyuncs.com", + "https://registry.docker-cn.com", ] } ``` @@ -41,16 +41,15 @@ $ sudo systemctl daemon-reload $ sudo systemctl restart docker ``` -注意:如果您之前查看旧教程,修改了 `docker.service` 文件内容,请去掉您添加的内容(`--registry-mirror=https://jxus37ad.mirror.aliyuncs.com`),这里不再赘述。 +注意:如果您之前查看旧教程,修改了 `docker.service` 文件内容,请去掉您添加的内容(`--registry-mirror=https://registry.docker-cn.com`),这里不再赘述。 ### Windows 10 -对于使用 Windows 10 的系统,在系统右下角托盘图标内右键菜单选择 `Settings`,打开配置窗口后左侧导航菜单选择 `Docker Daemon`。编辑窗口内的JSON串,填写加速器地址,如: +对于使用 Windows 10 的系统,在系统右下角托盘图标内右键菜单选择 `Settings`,打开配置窗口后左侧导航菜单选择 `Docker Daemon`。编辑窗口内的 JSON 串,填写加速器地址,如: ```json { "registry-mirrors": [ - "https://sr5arhkn.mirror.aliyuncs.com", - "http://14d216f4.m.daocloud.io" + "https://registry.docker-cn.com" ] } ``` @@ -59,7 +58,7 @@ $ sudo systemctl restart docker ### macOS -对于使用 macOS 的用户,在任务栏点击 Docker for mac 应用图标 -> Perferences... -> Daemon -> Registry mirrors。在列表中添加云服务商提供的加速器地址即可。修改完成之后,点击 `Apply & Restart` 按钮,Docker 就会重启并应用配置的镜像地址了。 +对于使用 macOS 的用户,在任务栏点击 Docker for mac 应用图标 -> Perferences... -> Daemon -> Registry mirrors。在列表中填写加速器地址即可。修改完成之后,点击 `Apply & Restart` 按钮,Docker 就会重启并应用配置的镜像地址了。 ### 检查加速器是否生效 diff --git a/introduction/what.md b/introduction/what.md index 7b3ef7a..739891c 100644 --- a/introduction/what.md +++ b/introduction/what.md @@ -2,9 +2,9 @@ Docker 最初是 dotCloud 公司创始人 Solomon Hykes 在法国期间发起的一个公司内部项目,它是基于 dotCloud 公司多年云服务技术的一次革新,并于 [2013 年 3 月以 Apache 2.0 授权协议开源][docker-soft],主要项目代码在 [GitHub](https://github.com/moby/moby) 上进行维护。Docker 项目后来还加入了 Linux 基金会,并成立推动 [开放容器联盟](https://www.opencontainers.org/)。 -Docker 自开源后受到广泛的关注和讨论,至今其 GitHub 项目已经超过 3 万 6 千个星标和一万多个 fork。甚至由于 Docker 项目的火爆,在 2013 年底,[dotCloud 公司决定改名为 Docker](https://blog.docker.com/2013/10/dotcloud-is-becoming-docker-inc/)。Docker 最初是在 Ubuntu 12.04 上开发实现的;Red Hat 则从 RHEL 6.5 开始对 Docker 进行支持;Google 也在其 PaaS 产品中广泛应用 Docker。 +Docker 自开源后受到广泛的关注和讨论,至今其 GitHub 项目已经超过 4 万 6 千个星标和一万多个 fork。甚至由于 Docker 项目的火爆,在 2013 年底,[dotCloud 公司决定改名为 Docker](https://blog.docker.com/2013/10/dotcloud-is-becoming-docker-inc/)。Docker 最初是在 Ubuntu 12.04 上开发实现的;Red Hat 则从 RHEL 6.5 开始对 Docker 进行支持;Google 也在其 PaaS 产品中广泛应用 Docker。 -Docker 使用 Google 公司推出的 [Go 语言](https://golang.org/) 进行开发实现,基于 Linux 内核的 [cgroup](https://zh.wikipedia.org/wiki/Cgroups),[namespace](https://en.wikipedia.org/wiki/Linux_namespaces),以及 [AUFS](https://en.wikipedia.org/wiki/Aufs) 类的 [Union FS](https://en.wikipedia.org/wiki/Union_mount) 等技术,对进程进行封装隔离,属于 [操作系统层面的虚拟化技术](https://en.wikipedia.org/wiki/Operating-system-level_virtualization)。由于隔离的进程独立于宿主和其它的隔离的进程,因此也称其为容器。最初实现是基于 [LXC](https://linuxcontainers.org/lxc/introduction/),从 0.7 以后开始去除 LXC,转而使用自行开发的 [libcontainer](https://github.com/docker/libcontainer),从 1.11 开始,则进一步演进为使用 [runC](http://runc.io/) 和 [containerd](https://containerd.tools/)。 +Docker 使用 Google 公司推出的 [Go 语言](https://golang.org/) 进行开发实现,基于 Linux 内核的 [cgroup](https://zh.wikipedia.org/wiki/Cgroups),[namespace](https://en.wikipedia.org/wiki/Linux_namespaces),以及 [AUFS](https://en.wikipedia.org/wiki/Aufs) 类的 [Union FS](https://en.wikipedia.org/wiki/Union_mount) 等技术,对进程进行封装隔离,属于 [操作系统层面的虚拟化技术](https://en.wikipedia.org/wiki/Operating-system-level_virtualization)。由于隔离的进程独立于宿主和其它的隔离的进程,因此也称其为容器。最初实现是基于 [LXC](https://linuxcontainers.org/lxc/introduction/),从 0.7 版本以后开始去除 LXC,转而使用自行开发的 [libcontainer](https://github.com/docker/libcontainer),从 1.11 开始,则进一步演进为使用 [runC](http://runc.io/) 和 [containerd](https://containerd.tools/)。 Docker 在容器的基础上,进行了进一步的封装,从文件系统、网络互联到进程隔离等等,极大的简化了容器的创建和维护。使得 Docker 技术比虚拟机技术更为轻便、快捷。 From 5ed1521c6acb92fd6120d22e423dac4b5768e97b Mon Sep 17 00:00:00 2001 From: khs1994 Date: Wed, 1 Nov 2017 15:50:44 +0800 Subject: [PATCH 3/3] Fix error in daemon json --- install/mirror.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/mirror.md b/install/mirror.md index d9a099c..dd03a8a 100644 --- a/install/mirror.md +++ b/install/mirror.md @@ -29,7 +29,7 @@ $ sudo service docker restart ```json { "registry-mirrors": [ - "https://registry.docker-cn.com", + "https://registry.docker-cn.com" ] } ``` @@ -62,7 +62,7 @@ $ sudo systemctl restart docker ### 检查加速器是否生效 -配置加速器之后,如果拉取镜像仍然十分缓慢,请手动检查加速器配置是否生效,在命令行执行 `$ docker info`,如果从结果中看到了如下内容,说明配置成功。 +配置加速器之后,如果拉取镜像仍然十分缓慢,请手动检查加速器配置是否生效,在命令行执行 `docker info`,如果从结果中看到了如下内容,说明配置成功。 ```bash Registry Mirrors: