diff --git a/README.md b/README.md index 681b885..55376a0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Docker — 从入门到实践 -[![](https://img.shields.io/github/stars/yeasy/docker_practice.svg?style=social&label=Stars)](https://github.com/yeasy/docker_practice) [![](https://img.shields.io/docker/pulls/yeasy/docker_practice.svg)](https://store.docker.com/community/images/yeasy/docker_practice) [![](https://travis-ci.org/yeasy/docker_practice.svg?branch=master)](https://travis-ci.org/yeasy/docker_practice) [![](https://img.shields.io/github/release/yeasy/docker_practice/all.svg)](https://github.com/yeasy/docker_practice/releases) [![](https://badges.gitter.im/docker_practice/Lobby.svg)](https://gitter.im/docker_practice/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![](https://img.shields.io/github/stars/yeasy/docker_practice.svg?style=social&label=Stars)](https://github.com/yeasy/docker_practice) ![](https://img.shields.io/docker/pulls/yeasy/docker_practice.svg) [![](https://travis-ci.org/yeasy/docker_practice.svg?branch=master)](https://travis-ci.org/yeasy/docker_practice) [![](https://img.shields.io/github/release/yeasy/docker_practice/all.svg)](https://github.com/yeasy/docker_practice/releases) [![](https://badges.gitter.im/docker_practice/Lobby.svg)](https://gitter.im/docker_practice/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) v1.0.0 diff --git a/appendix/repo/centos.md b/appendix/repo/centos.md index 4046c89..96b7d71 100644 --- a/appendix/repo/centos.md +++ b/appendix/repo/centos.md @@ -1,10 +1,10 @@ -## [CentOS](https://store.docker.com/images/centos/) +## [CentOS](https://hub.docker.com/_/centos) ### 基本信息 [CentOS](https://en.wikipedia.org/wiki/CentOS) 是流行的 Linux 发行版,其软件包大多跟 RedHat 系列保持一致。 -该仓库位于 https://store.docker.com/images/centos/ ,提供了 CentOS 从 5 ~ 7 各个版本的镜像。 +该仓库位于 `https://hub.docker.com/_/centos` ,提供了 CentOS 从 5 ~ 7 各个版本的镜像。 ### 使用方法 diff --git a/appendix/repo/mongodb.md b/appendix/repo/mongodb.md index 2890e97..1c5ea52 100644 --- a/appendix/repo/mongodb.md +++ b/appendix/repo/mongodb.md @@ -1,10 +1,10 @@ -## [MongoDB](https://store.docker.com/images/mongo/) +## [MongoDB](https://hub.docker.com/_/mongo/) ### 基本信息 [MongoDB](https://en.wikipedia.org/wiki/MongoDB) 是开源的 NoSQL 数据库实现。 -该仓库位于 https://store.docker.com/images/mongo/ ,提供了 MongoDB 2.x ~ 3.x 各个版本的镜像。 +该仓库位于 `https://hub.docker.com/_/mongo/` ,提供了 MongoDB 2.x ~ 3.x 各个版本的镜像。 ### 使用方法 diff --git a/appendix/repo/mysql.md b/appendix/repo/mysql.md index 3b842f9..314b6b8 100644 --- a/appendix/repo/mysql.md +++ b/appendix/repo/mysql.md @@ -1,10 +1,10 @@ -## [MySQL](https://store.docker.com/images/mysql/) +## [MySQL](https://hub.docker.com/_/mysql/) ### 基本信息 [MySQL](https://en.wikipedia.org/wiki/MySQL) 是开源的关系数据库实现。 -该仓库位于 https://store.docker.com/images/mysql/ ,提供了 MySQL 5.5 ~ 8.x 各个版本的镜像。 +该仓库位于 `https://hub.docker.com/_/mysql/` ,提供了 MySQL 5.5 ~ 8.x 各个版本的镜像。 ### 使用方法 diff --git a/appendix/repo/nginx.md b/appendix/repo/nginx.md index 1d1b805..7cd7471 100644 --- a/appendix/repo/nginx.md +++ b/appendix/repo/nginx.md @@ -1,10 +1,10 @@ -## [Nginx](https://store.docker.com/images/nginx/) +## [Nginx](https://hub.docker.com/_/nginx/) ### 基本信息 [Nginx](https://en.wikipedia.org/wiki/Nginx) 是开源的高效的 Web 服务器实现,支持 HTTP、HTTPS、SMTP、POP3、IMAP 等协议。 -该仓库位于 https://store.docker.com/images/nginx/ ,提供了 Nginx 1.0 ~ 1.13.x 各个版本的镜像。 +该仓库位于 `https://hub.docker.com/_/nginx/` ,提供了 Nginx 1.0 ~ 1.13.x 各个版本的镜像。 ### 使用方法 diff --git a/appendix/repo/nodejs.md b/appendix/repo/nodejs.md index 48b5e51..229dd6b 100644 --- a/appendix/repo/nodejs.md +++ b/appendix/repo/nodejs.md @@ -1,10 +1,10 @@ -## [Node.js](https://store.docker.com/images/node/) +## [Node.js](https://hub.docker.com/_/node/) ### 基本信息 [Node.js](https://en.wikipedia.org/wiki/Node.js) 是基于 JavaScript 的可扩展服务端和网络软件开发平台。 -该仓库位于 https://store.docker.com/images/node/ ,提供了 Node.js 0.10 ~ 9.x 各个版本的镜像。 +该仓库位于 `https://hub.docker.com/_/node/` ,提供了 Node.js 0.10 ~ 9.x 各个版本的镜像。 ### 使用方法 diff --git a/appendix/repo/redis.md b/appendix/repo/redis.md index fe514df..168ad92 100644 --- a/appendix/repo/redis.md +++ b/appendix/repo/redis.md @@ -1,10 +1,10 @@ -## [Redis](https://store.docker.com/images/redis/) +## [Redis](https://hub.docker.com/_/redis/) ### 基本信息 [Redis](https://en.wikipedia.org/wiki/Redis) 是开源的内存 Key-Value 数据库实现。 -该仓库位于 https://store.docker.com/images/redis/ ,提供了 Redis 3.x ~ 4.x 各个版本的镜像。 +该仓库位于 `https://hub.docker.com/_/redis/` ,提供了 Redis 3.x ~ 4.x 各个版本的镜像。 ### 使用方法 diff --git a/appendix/repo/ubuntu.md b/appendix/repo/ubuntu.md index 8a95bdf..769ff2a 100644 --- a/appendix/repo/ubuntu.md +++ b/appendix/repo/ubuntu.md @@ -1,10 +1,10 @@ -## [Ubuntu](https://store.docker.com/images/ubuntu/) +## [Ubuntu](https://hub.docker.com/_/ubuntu/) ### 基本信息 [Ubuntu](https://en.wikipedia.org/wiki/Ubuntu) 是流行的 Linux 发行版,其自带软件版本往往较新一些。 -该仓库位于 https://store.docker.com/images/ubuntu/ ,提供了 Ubuntu 从 12.04 ~ 18.04 各个版本的镜像。 +该仓库位于 `https://hub.docker.com/_/ubuntu/` ,提供了 Ubuntu 从 12.04 ~ 18.04 各个版本的镜像。 ### 使用方法 diff --git a/appendix/repo/wordpress.md b/appendix/repo/wordpress.md index 4cded1e..7b8037b 100644 --- a/appendix/repo/wordpress.md +++ b/appendix/repo/wordpress.md @@ -1,10 +1,10 @@ -## [WordPress](https://store.docker.com/images/wordpress/) +## [WordPress](https://hub.docker.com/_/wordpress/) ### 基本信息 [WordPress](https://en.wikipedia.org/wiki/WordPress) 是开源的 Blog 和内容管理系统框架,它基于 PHP 和 MySQL。 -该仓库位于 https://store.docker.com/images/wordpress/ ,提供了 WordPress 4.x 版本的镜像。 +该仓库位于 `https://hub.docker.com/_/wordpress/` ,提供了 WordPress 4.x 版本的镜像。 ### 使用方法 diff --git a/appendix/resources/README.md b/appendix/resources/README.md index 8773926..155038c 100644 --- a/appendix/resources/README.md +++ b/appendix/resources/README.md @@ -5,8 +5,6 @@ * Docker 官方主页:https://www.docker.com * Docker 官方博客:https://blog.docker.com/ * Docker 官方文档:https://docs.docker.com/ -* Docker Store:https://store.docker.com -* Docker Cloud:https://cloud.docker.com * Docker Hub:https://hub.docker.com * Docker 的源代码仓库:https://github.com/moby/moby * Docker 发布版本历史:https://docs.docker.com/release-notes/ diff --git a/basic_concept/repository.md b/basic_concept/repository.md index fcbecb4..a6ba18e 100644 --- a/basic_concept/repository.md +++ b/basic_concept/repository.md @@ -6,7 +6,7 @@ 通常,一个仓库会包含同一个软件不同版本的镜像,而标签就常用于对应该软件的各个版本。我们可以通过 `<仓库名>:<标签>` 的格式来指定具体是这个软件哪个版本的镜像。如果不给出标签,将以 `latest` 作为默认标签。 -以 [Ubuntu 镜像](https://store.docker.com/images/ubuntu) 为例,`ubuntu` 是仓库的名字,其内包含有不同的版本标签,如,`16.04`, `18.04`。我们可以通过 `ubuntu:14.04`,或者 `ubuntu:18.04` 来具体指定所需哪个版本的镜像。如果忽略了标签,比如 `ubuntu`,那将视为 `ubuntu:latest`。 +以 [Ubuntu 镜像](https://hub.docker.com/_/ubuntu) 为例,`ubuntu` 是仓库的名字,其内包含有不同的版本标签,如,`16.04`, `18.04`。我们可以通过 `ubuntu:14.04`,或者 `ubuntu:18.04` 来具体指定所需哪个版本的镜像。如果忽略了标签,比如 `ubuntu`,那将视为 `ubuntu:latest`。 仓库名经常以 *两段式路径* 形式出现,比如 `jwilder/nginx-proxy`,前者往往意味着 Docker Registry 多用户环境下的用户名,后者则往往是对应的软件名。但这并非绝对,取决于所使用的具体 Docker Registry 的软件或服务。 @@ -22,7 +22,7 @@ Docker Registry 公开服务是开放给用户使用、允许用户管理镜像 ### 私有 Docker Registry -除了使用公开服务外,用户还可以在本地搭建私有 Docker Registry。Docker 官方提供了 [Docker Registry](https://store.docker.com/images/registry/) 镜像,可以直接使用做为私有 Registry 服务。在 [私有仓库](../repository/registry.md) 一节中,会有进一步的搭建私有 Registry 服务的讲解。 +除了使用公开服务外,用户还可以在本地搭建私有 Docker Registry。Docker 官方提供了 [Docker Registry](https://hub.docker.com/_/registry/) 镜像,可以直接使用做为私有 Registry 服务。在 [私有仓库](../repository/registry.md) 一节中,会有进一步的搭建私有 Registry 服务的讲解。 开源的 Docker Registry 镜像只提供了 [Docker Registry API](https://docs.docker.com/registry/spec/api/) 的服务端实现,足以支持 `docker` 命令,不影响使用。但不包含图形界面,以及镜像维护、用户管理、访问控制等高级功能。在官方的商业化版本 [Docker Trusted Registry](https://docs.docker.com/datacenter/dtr/2.0/) 中,提供了这些高级功能。 diff --git a/compose/django.md b/compose/django.md index 08ece07..e0447bb 100644 --- a/compose/django.md +++ b/compose/django.md @@ -84,7 +84,7 @@ DATABASES = { } ``` -这些信息是在 [postgres](https://store.docker.com/images/postgres/) 镜像固定设置好的。然后,运行 `docker-compose up` : +这些信息是在 [postgres](https://hub.docker.com/_/postgres/) 镜像固定设置好的。然后,运行 `docker-compose up` : ```bash $ docker-compose up diff --git a/image/build.md b/image/build.md index 88a8254..e4f6533 100644 --- a/image/build.md +++ b/image/build.md @@ -27,9 +27,9 @@ RUN echo '

Hello, Docker!

' > /usr/share/nginx/html/index.html 所谓定制镜像,那一定是以一个镜像为基础,在其上进行定制。就像我们之前运行了一个 `nginx` 镜像的容器,再进行修改一样,基础镜像是必须指定的。而 `FROM` 就是指定**基础镜像**,因此一个 `Dockerfile` 中 `FROM` 是必备的指令,并且必须是第一条指令。 -在 [Docker Store](https://store.docker.com) 上有非常多的高质量的官方镜像,有可以直接拿来使用的服务类的镜像,如 [`nginx`](https://store.docker.com/images/nginx/)、[`redis`](https://store.docker.com/images/redis/)、[`mongo`](https://store.docker.com/images/mongo/)、[`mysql`](https://store.docker.com/images/mysql/)、[`httpd`](https://store.docker.com/images/httpd/)、[`php`](https://store.docker.com/images/php/)、[`tomcat`](https://store.docker.com/images/tomcat/) 等;也有一些方便开发、构建、运行各种语言应用的镜像,如 [`node`](https://store.docker.com/images/node)、[`openjdk`](https://store.docker.com/images/openjdk/)、[`python`](https://store.docker.com/images/python/)、[`ruby`](https://store.docker.com/images/ruby/)、[`golang`](https://store.docker.com/images/golang/) 等。可以在其中寻找一个最符合我们最终目标的镜像为基础镜像进行定制。 +在 [Docker Hub](https://hub.docker.com/search?q=&type=image&image_filter=official) 上有非常多的高质量的官方镜像,有可以直接拿来使用的服务类的镜像,如 [`nginx`](https://hub.docker.com/_/nginx/)、[`redis`](https://hub.docker.com/_/redis/)、[`mongo`](https://hub.docker.com/_/mongo/)、[`mysql`](https://hub.docker.com/_/mysql/)、[`httpd`](https://hub.docker.com/_/httpd/)、[`php`](https://hub.docker.com/_/php/)、[`tomcat`](https://hub.docker.com/_/tomcat/) 等;也有一些方便开发、构建、运行各种语言应用的镜像,如 [`node`](https://hub.docker.com/_/node)、[`openjdk`](https://hub.docker.com/_/openjdk/)、[`python`](https://hub.docker.com/_/python/)、[`ruby`](https://hub.docker.com/_/ruby/)、[`golang`](https://hub.docker.com/_/golang/) 等。可以在其中寻找一个最符合我们最终目标的镜像为基础镜像进行定制。 -如果没有找到对应服务的镜像,官方镜像中还提供了一些更为基础的操作系统镜像,如 [`ubuntu`](https://store.docker.com/images/ubuntu/)、[`debian`](https://store.docker.com/images/debian/)、[`centos`](https://store.docker.com/images/centos/)、[`fedora`](https://store.docker.com/images/fedora/)、[`alpine`](https://store.docker.com/images/alpine/) 等,这些操作系统的软件库为我们提供了更广阔的扩展空间。 +如果没有找到对应服务的镜像,官方镜像中还提供了一些更为基础的操作系统镜像,如 [`ubuntu`](https://hub.docker.com/_/ubuntu/)、[`debian`](https://hub.docker.com/_/debian/)、[`centos`](https://hub.docker.com/_/centos/)、[`fedora`](https://hub.docker.com/_/fedora/)、[`alpine`](https://hub.docker.com/_/alpine/) 等,这些操作系统的软件库为我们提供了更广阔的扩展空间。 除了选择现有镜像为基础镜像外,Docker 还存在一个特殊的镜像,名为 `scratch`。这个镜像是虚拟的概念,并不实际存在,它表示一个空白的镜像。 diff --git a/install/mac.md b/install/mac.md index ee47789..2778f56 100644 --- a/install/mac.md +++ b/install/mac.md @@ -51,7 +51,7 @@ $ docker-machine --version docker-machine version 0.13.0, build 9ba6da9 ``` -如果 `docker version`、`docker info` 都正常的话,可以尝试运行一个 [Nginx 服务器](https://store.docker.com/images/nginx/): +如果 `docker version`、`docker info` 都正常的话,可以尝试运行一个 [Nginx 服务器](https://hub.docker.com/_/nginx/): ```bash $ docker run -d -p 80:80 --name webserver nginx diff --git a/introduction/why.md b/introduction/why.md index b087eaf..0f7ae08 100644 --- a/introduction/why.md +++ b/introduction/why.md @@ -28,7 +28,7 @@ ### 更轻松的维护和扩展 -Docker 使用的分层存储以及镜像的技术,使得应用重复部分的复用更为容易,也使得应用的维护更新更加简单,基于基础镜像进一步扩展镜像也变得非常简单。此外,Docker 团队同各个开源项目团队一起维护了一大批高质量的 [官方镜像](https://store.docker.com/search?q=&source=verified&type=image),既可以直接在生产环境使用,又可以作为基础进一步定制,大大的降低了应用服务的镜像制作成本。 +Docker 使用的分层存储以及镜像的技术,使得应用重复部分的复用更为容易,也使得应用的维护更新更加简单,基于基础镜像进一步扩展镜像也变得非常简单。此外,Docker 团队同各个开源项目团队一起维护了一大批高质量的 [官方镜像](https://hub.docker.com/search/?type=image&image_filter=official),既可以直接在生产环境使用,又可以作为基础进一步定制,大大的降低了应用服务的镜像制作成本。 ### 对比传统虚拟机总结