From 4958b227d7929ae8482001e629b24baf760220e9 Mon Sep 17 00:00:00 2001 From: khs1994 Date: Tue, 5 Dec 2017 11:03:39 +0800 Subject: [PATCH 1/8] Update network:Change --net TO --network --- network/README.md | 2 -- network/linking.md | 6 ++++-- network/port_mapping.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/network/README.md b/network/README.md index 55a4556..d1b7dcf 100644 --- a/network/README.md +++ b/network/README.md @@ -1,5 +1,3 @@ # Docker 中的网络功能介绍 Docker 允许通过外部访问容器或容器互联的方式来提供网络服务。 - -Docker 在 1.13 版本引进了新的管理命令(management commands),在 Docker 1.13+ 推荐使用 `docker network` 子命令来管理 Docker 网络。 diff --git a/network/linking.md b/network/linking.md index ea42c6a..a4319a5 100644 --- a/network/linking.md +++ b/network/linking.md @@ -19,18 +19,20 @@ $ docker network create -d bridge my-net 运行一个容器并连接到新建的 `my-net` 网络 ```bash -$ docker run -it --rm --name busybox1 --net my-net busybox sh +$ docker run -it --rm --name busybox1 --network my-net busybox sh ``` 打开新的终端,再运行一个容器并加入到 `my-net` 网络 ```bash -$ docker run -it --rm --name busybox2 --net my-net busybox sh +$ docker run -it --rm --name busybox2 --network my-net busybox sh ``` 再打开一个新的终端查看容器信息 ```bash +$ docker container ls + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b47060aca56b busybox "sh" 11 minutes ago Up 11 minutes busybox2 8720575823ec busybox "sh" 16 minutes ago Up 16 minutes busybox1 diff --git a/network/port_mapping.md b/network/port_mapping.md index 0281754..1fff097 100644 --- a/network/port_mapping.md +++ b/network/port_mapping.md @@ -4,7 +4,7 @@ 当使用 `-P` 标记时,Docker 会随机映射一个 `49000~49900` 的端口到内部容器开放的网络端口。 -使用 `docker ps` 可以看到,本地主机的 49155 被映射到了容器的 5000 端口。此时访问本机的 49155 端口即可访问容器内 web 应用提供的界面。 +使用 `docker container ls` 可以看到,本地主机的 49155 被映射到了容器的 5000 端口。此时访问本机的 49155 端口即可访问容器内 web 应用提供的界面。 ```bash $ docker run -d -P training/webapp python app.py From 3aecfc8b5452daf790dd536b6824eb89130fd9cb Mon Sep 17 00:00:00 2001 From: khs1994 Date: Tue, 5 Dec 2017 11:14:56 +0800 Subject: [PATCH 2/8] Update container:Change docker images TO docker image ls #279 --- container/import_export.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/import_export.md b/container/import_export.md index 866c964..1ee0886 100644 --- a/container/import_export.md +++ b/container/import_export.md @@ -18,7 +18,7 @@ $ docker export 7691a814370e > ubuntu.tar ```bash $ cat ubuntu.tar | docker import - test/ubuntu:v1.0 -$ docker images +$ docker image ls REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE test/ubuntu v1.0 9d37a6082e97 About a minute ago 171.3 MB ``` From edd4464176aa71f0fad9c3dc2c1a8c85ae965c0f Mon Sep 17 00:00:00 2001 From: khs1994 Date: Tue, 5 Dec 2017 11:15:24 +0800 Subject: [PATCH 3/8] Update Registry AND #279 --- repository/dockerhub.md | 2 +- repository/registry.md | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/repository/dockerhub.md b/repository/dockerhub.md index ebc1a2a..80f366b 100644 --- a/repository/dockerhub.md +++ b/repository/dockerhub.md @@ -60,7 +60,7 @@ Pulling repository centos ```bash $ docker tag ubuntu:17.10 username/ubuntu:17.10 -$ docker images +$ docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE ubuntu 17.10 275d79972a86 6 days ago 94.6MB diff --git a/repository/registry.md b/repository/registry.md index 6ab060b..51d68c4 100644 --- a/repository/registry.md +++ b/repository/registry.md @@ -32,16 +32,18 @@ $ docker run -d \ 先在本机查看已有的镜像。 ```bash -$ docker images +$ docker image ls REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ubuntu latest ba5877dc9bec 6 weeks ago 192.7 MB ``` -使用 `docker tag` 将 `ubuntu:latest` 这个镜像标记为 `127.0.0.1:5000/ubuntu:latest`(格式为 `docker tag IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]`)。 +使用 `docker tag` 将 `ubuntu:latest` 这个镜像标记为 `127.0.0.1:5000/ubuntu:latest`。 + +格式为 `docker tag IMAGE[:TAG] [REGISTRY_HOST[:REGISTRY_PORT]/]REPOSITORY[:TAG]`。 ```bash $ docker tag ubuntu:latest 127.0.0.1:5000/ubuntu:latest -$ docker images +$ docker image ls REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ubuntu latest ba5877dc9bec 6 weeks ago 192.7 MB 127.0.0.1:5000/ubuntu:latest latest ba5877dc9bec 6 weeks ago 192.7 MB @@ -73,7 +75,7 @@ $ curl 127.0.0.1:5000/v2/_catalog 先删除已有镜像,再尝试从私有仓库中下载这个镜像。 ```bash -$ docker rmi 127.0.0.1:5000/ubuntu:latest +$ docker image rm 127.0.0.1:5000/ubuntu:latest $ docker pull 127.0.0.1:5000/ubuntu:latest Pulling repository 127.0.0.1:5000/ubuntu:latest @@ -84,7 +86,7 @@ ba5877dc9bec: Download complete ebc34468f71d: Download complete 2318d26665ef: Download complete -$ docker images +$ docker image ls REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE 127.0.0.1:5000/ubuntu:latest latest ba5877dc9bec 6 weeks ago 192.7 MB ``` From 3a09552f975e57156a8231a78e459e27f66fee6c Mon Sep 17 00:00:00 2001 From: khs1994 Date: Tue, 5 Dec 2017 11:15:59 +0800 Subject: [PATCH 4/8] Update: #279 --- cases/os/busybox.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cases/os/busybox.md b/cases/os/busybox.md index 6364dce..188e331 100644 --- a/cases/os/busybox.md +++ b/cases/os/busybox.md @@ -39,7 +39,7 @@ Status: Downloaded newer image for busybox:latest 下载后,可以看到 busybox 镜像只有2.433 MB: ```bash -$ docker images +$ docker image ls REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE busybox latest e72ac664f4f0 6 weeks ago 2.433 MB ``` From de1be5e574bab7ca065b92dc83bcb62be2c7c1ce Mon Sep 17 00:00:00 2001 From: khs1994 Date: Tue, 5 Dec 2017 11:16:51 +0800 Subject: [PATCH 5/8] Update revision --- revision.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/revision.md b/revision.md index 5155295..cbc2e53 100644 --- a/revision.md +++ b/revision.md @@ -6,15 +6,23 @@ * 0.9-rc2: 2017-12-10 - * 更新 `CoreOS` 章节 + * 增加 Docker 中文资源链接 + * 增加介绍基于 Docker 的 CI/CD 工具 `Drone` + * 增加 `docker secret` 相关内容 + * 更新 `CoreOS` 章节 * 更新 `etcd` 章节,基于 3.x 版本 - * 增加 Docker 中文资源链接 - - * 增加介绍基于 Docker 的 CI/CD 工具 Drone + * 删除 `Docker Compose` 中的 `links`指令 * 替换 `docker daemon` 命令为 `dockerd` + * 替换 `docker ps` 命令为 `docker container ls` + * 替换 `docker images` 命令为 `docker image ls` + + * 优化文字排版 + * 调整目录结构 + * 修复内容逻辑错误 + * 修复`404` 链接 * 0.9-rc1: 2017-11-29 @@ -37,8 +45,8 @@ * 精简 `Docker Registry` 一节 * 替换 `docker run` `-v` 参数为 `--mount` - * 替换 `404` 链接 + * 修复 `404` 链接 * 优化文字排版 * 增加离线阅读功能 From 240c26edf83a1b56a64fff88fce88c29a4ff5c68 Mon Sep 17 00:00:00 2001 From: khs1994 Date: Tue, 5 Dec 2017 11:33:33 +0800 Subject: [PATCH 6/8] Change revision.md to CHANGELOG.md AND Move CONTRIBUTING.md to root --- revision.md => CHANGELOG.md | 0 .github/CONTRIBUTING.md => CONTRIBUTING.md | 0 SUMMARY.md | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename revision.md => CHANGELOG.md (100%) rename .github/CONTRIBUTING.md => CONTRIBUTING.md (100%) diff --git a/revision.md b/CHANGELOG.md similarity index 100% rename from revision.md rename to CHANGELOG.md diff --git a/.github/CONTRIBUTING.md b/CONTRIBUTING.md similarity index 100% rename from .github/CONTRIBUTING.md rename to CONTRIBUTING.md diff --git a/SUMMARY.md b/SUMMARY.md index 76d602a..4f5f172 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -1,8 +1,8 @@ # [Docker — 从入门到实践](https://github.com/yeasy/docker_practice/blob/master/SUMMARY.md) * [前言](README.md) -* [修订记录](revision.md) -* [如何贡献](.github/CONTRIBUTING.md) +* [修订记录](CHANGELOG.md) +* [如何贡献](CONTRIBUTING.md) * [Docker 简介](introduction/README.md) * [什么是 Docker](introduction/what.md) * [为什么要用 Docker](introduction/why.md) From 90b6d52969af747c8ca60ca62fbae81878116231 Mon Sep 17 00:00:00 2001 From: khs1994 Date: Tue, 5 Dec 2017 12:36:26 +0800 Subject: [PATCH 7/8] Change revision.md to CHANGELOG.md AND Move CONTRIBUTING.md to root --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e3c7a9e..0d2fb1b 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ * pdf 版本 [下载](https://www.gitbook.com/download/pdf/book/yeasy/docker_practice) * epub 版本 [下载](https://www.gitbook.com/download/epub/book/yeasy/docker_practice) -Docker 自身仍在快速发展中,生态环境也在蓬勃成长。建议初学者使用最新版的 Docker (v17.x) 进行学习实践。欢迎 [参与维护项目](.github/CONTRIBUTING.md)。 +Docker 自身仍在快速发展中,生态环境也在蓬勃成长。建议初学者使用最新版的 Docker (v17.x) 进行学习实践。欢迎 [参与维护项目](CONTRIBUTING.md)。 -* [修订记录](revision.md) +* [修订记录](CHANGELOG.md) * [贡献者名单](https://github.com/yeasy/docker_practice/graphs/contributors) ## 技术交流 From 8e31d114f8092ffe661c37dbd9d62d6a39e108e4 Mon Sep 17 00:00:00 2001 From: khs1994 Date: Tue, 5 Dec 2017 13:04:01 +0800 Subject: [PATCH 8/8] Add docker-library/docs in dockerfile/references.md --- image/dockerfile/references.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/image/dockerfile/references.md b/image/dockerfile/references.md index ba465c8..4e0bd84 100644 --- a/image/dockerfile/references.md +++ b/image/dockerfile/references.md @@ -1,4 +1,7 @@ ### 参考文档 -* Dockerfie 官方文档: -* Dockerfile 最佳实践文档: +* `Dockerfie` 官方文档:https://docs.docker.com/engine/reference/builder/ + +* `Dockerfile` 最佳实践文档:https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/ + +* `Docker` 官方镜像 `Dockerfile`:https://github.com/docker-library/docs