diff --git a/appendix/repo/centos.md b/appendix/repo/centos.md index 44db1ab..a17b2f5 100644 --- a/appendix/repo/centos.md +++ b/appendix/repo/centos.md @@ -3,7 +3,7 @@ ### 基本信息 [CentOS](https://en.wikipedia.org/wiki/CentOS) 是流行的 Linux 发行版,其软件包大多跟 RedHat 系列保持一致。 -该仓库位于 https://hub.docker.com/_/centos/,提供了 CentOS 从 5 ~ 7 各个版本的镜像。 +该仓库位于 https://hub.docker.com/_/centos/ ,提供了 CentOS 从 5 ~ 7 各个版本的镜像。 ### 使用方法 默认会启动一个最小化的 CentOS 环境。 @@ -56,3 +56,5 @@ LABEL name="CentOS Base Image" \ CMD ["/bin/bash"] ``` + + diff --git a/appendix/repo/mongodb.md b/appendix/repo/mongodb.md index 3ee4452..47304e8 100644 --- a/appendix/repo/mongodb.md +++ b/appendix/repo/mongodb.md @@ -3,7 +3,7 @@ ### 基本信息 [MongoDB](https://en.wikipedia.org/wiki/MongoDB) 是开源的 NoSQL 数据库实现。 -该仓库位于 https://hub.docker.com/_/mongo/,提供了 MongoDB 2.x ~ 3.x 各个版本的镜像。 +该仓库位于 https://hub.docker.com/_/mongo/ ,提供了 MongoDB 2.x ~ 3.x 各个版本的镜像。 ### 使用方法 默认会在 `27017` 端口启动数据库。 @@ -260,4 +260,5 @@ ENTRYPOINT ["/entrypoint.sh"] EXPOSE 27017 CMD ["mongod"] -``` \ No newline at end of file +``` + diff --git a/appendix/repo/mysql.md b/appendix/repo/mysql.md index de5b6b4..58f22f3 100644 --- a/appendix/repo/mysql.md +++ b/appendix/repo/mysql.md @@ -3,7 +3,7 @@ ### 基本信息 [MySQL](https://en.wikipedia.org/wiki/MySQL) 是开源的关系数据库实现。 -该仓库位于 https://hub.docker.com/_/mysql/,提供了 MySQL 各个版本的镜像,包括 5.6 系列、5.7 系列等。 +该仓库位于 https://hub.docker.com/_/mysql/ ,提供了 MySQL 各个版本的镜像,包括 5.6 系列、5.7 系列等。 ### 使用方法 默认会在 `3306` 端口启动数据库。 @@ -122,3 +122,5 @@ ENTRYPOINT ["/entrypoint.sh"] EXPOSE 3306 CMD ["mysqld", "--datadir=/var/lib/mysql", "--user=mysql"] ``` + + diff --git a/appendix/repo/nginx.md b/appendix/repo/nginx.md index ff88922..62455d2 100644 --- a/appendix/repo/nginx.md +++ b/appendix/repo/nginx.md @@ -3,7 +3,7 @@ ### 基本信息 [Nginx](https://en.wikipedia.org/wiki/Nginx) 是开源的高效的 Web 服务器实现,支持 HTTP、HTTPS、SMTP、POP3、IMAP 等协议。 -该仓库位于 https://hub.docker.com/_/nginx/,提供了 Nginx 1.0 ~ 1.11.x 各个版本的镜像。 +该仓库位于 https://hub.docker.com/_/nginx/ ,提供了 Nginx 1.0 ~ 1.11.x 各个版本的镜像。 ### 使用方法 下面的命令将作为一个静态页面服务器启动。 @@ -99,3 +99,5 @@ EXPOSE 80 443 CMD ["nginx", "-g", "daemon off;"] ``` + + diff --git a/appendix/repo/nodejs.md b/appendix/repo/nodejs.md index 55295a6..a2993b0 100644 --- a/appendix/repo/nodejs.md +++ b/appendix/repo/nodejs.md @@ -3,7 +3,7 @@ ### 基本信息 [Node.js](https://en.wikipedia.org/wiki/Node.js)是基于 JavaScript 的可扩展服务端和网络软件开发平台。 -该仓库位于 https://hub.docker.com/_/node/,提供了 Node.js 0.10 ~ 6.3.x 各个版本的镜像。 +该仓库位于 https://hub.docker.com/_/node/ ,提供了 Node.js 0.10 ~ 6.3.x 各个版本的镜像。 ### 使用方法 在项目中创建一个 Dockerfile。 diff --git a/appendix/repo/redis.md b/appendix/repo/redis.md index cadeefc..a3771e6 100644 --- a/appendix/repo/redis.md +++ b/appendix/repo/redis.md @@ -3,7 +3,7 @@ ### 基本信息 [Redis](https://en.wikipedia.org/wiki/Redis) 是开源的内存 Key-Value 数据库实现。 -该仓库位于 https://hub.docker.com/_/redis/,提供了 Redis 3.x 各个版本的镜像。 +该仓库位于 https://hub.docker.com/_/redis/ ,提供了 Redis 3.x 各个版本的镜像。 ### 使用方法 默认会在 `6379` 端口启动数据库。 @@ -139,3 +139,5 @@ ENTRYPOINT ["docker-entrypoint.sh"] EXPOSE 6379 CMD [ "redis-server" ] ``` + + diff --git a/appendix/repo/ubuntu.md b/appendix/repo/ubuntu.md index 2253678..46faddf 100644 --- a/appendix/repo/ubuntu.md +++ b/appendix/repo/ubuntu.md @@ -3,7 +3,7 @@ ### 基本信息 [Ubuntu](https://en.wikipedia.org/wiki/Ubuntu) 是流行的 Linux 发行版,其自带软件版本往往较新一些。 -该仓库位于 https://hub.docker.com/_/ubuntu/,提供了 Ubuntu 从 12.04 ~ 16.10 各个版本的镜像。 +该仓库位于 https://hub.docker.com/_/ubuntu/ ,提供了 Ubuntu 从 12.04 ~ 16.10 各个版本的镜像。 ### 使用方法 默认会启动一个最小化的 Ubuntu 环境。 @@ -140,3 +140,5 @@ RUN sed -i 's/^#\s*\(deb.*universe\)$/\1/g' /etc/apt/sources.list # overwrite this with 'CMD []' in a dependent Dockerfile CMD ["/bin/bash"] ``` + + diff --git a/appendix/repo/wordpress.md b/appendix/repo/wordpress.md index 1250db5..1bad0ab 100644 --- a/appendix/repo/wordpress.md +++ b/appendix/repo/wordpress.md @@ -3,7 +3,7 @@ ### 基本信息 [WordPress](https://en.wikipedia.org/wiki/WordPress) 是开源的 Blog 和内容管理系统框架,它基于 PhP 和 MySQL。 -该仓库位于 https://hub.docker.com/_/wordpress/,提供了 WordPress 4.x 版本的镜像。 +该仓库位于 https://hub.docker.com/_/wordpress/ ,提供了 WordPress 4.x 版本的镜像。 ### 使用方法 启动容器需要 MySQL 的支持,默认端口为 `80`。 @@ -114,4 +114,5 @@ COPY docker-entrypoint.sh /entrypoint.sh # grr, ENTRYPOINT resets CMD now ENTRYPOINT ["/entrypoint.sh"] CMD ["apache2-foreground"] -``` \ No newline at end of file +``` + diff --git a/data_management/volume.md b/data_management/volume.md index 42542e0..6d44883 100644 --- a/data_management/volume.md +++ b/data_management/volume.md @@ -56,6 +56,21 @@ $ docker inspect web } ... ``` +注:从Docker 1.8.0起,数据卷配置在"Mounts"Key下面,可以看到所有的数据卷都是创建在主机的`/mnt/sda1/var/lib/docker/volumes/....`下面了。 +``` +"Mounts": [ + { + "Name": "b53ebd40054dae599faf7c9666acfe205c3e922fc3e8bc3f2fd178ed788f1c29", + "Source": "/mnt/sda1/var/lib/docker/volumes/b53ebd40054dae599faf7c9666acfe205c3e922fc3e8bc3f2fd178ed788f1c29/_data", + "Destination": "/webapp", + "Driver": "local", + "Mode": "", + "RW": true, + "Propagation": "" + } + ] +... +``` ### 挂载一个本地主机文件作为数据卷 `-v` 标记也可以从主机挂载单个文件到容器中 diff --git a/image/dockerfile/cmd.md b/image/dockerfile/cmd.md index 56c421a..120abc3 100644 --- a/image/dockerfile/cmd.md +++ b/image/dockerfile/cmd.md @@ -45,5 +45,5 @@ CMD service nginx start 正确的做法是直接执行 `nginx` 可执行文件,并且要求以前台形式运行。比如: ```Dockerfile -CMD ["nginx" "-g" "daemon off;"] +CMD ["nginx", "-g", "daemon off;"] ```