Update title style

Signed-off-by: Kang HuaiShuai <khs1994@khs1994.com>
pull/432/head
Kang HuaiShuai 2019-11-06 14:53:09 +08:00
parent 99e470eb2a
commit 5cb92f63cf
No known key found for this signature in database
GPG Key ID: 0A380828B1C243A7
60 changed files with 224 additions and 232 deletions

View File

@ -312,12 +312,11 @@ module.exports = {
'opensource/linuxkit', 'opensource/linuxkit',
], ],
}, },
'appendix/faq/',
{ {
title: "附录", title: "热门镜像介绍",
collapsable: false, collapsable: false,
children: [ children: [
'appendix/',
'appendix/faq/',
'appendix/repo/', 'appendix/repo/',
'appendix/repo/ubuntu', 'appendix/repo/ubuntu',
'appendix/repo/centos', 'appendix/repo/centos',
@ -328,19 +327,13 @@ module.exports = {
'appendix/repo/wordpress', 'appendix/repo/wordpress',
'appendix/repo/mongodb', 'appendix/repo/mongodb',
'appendix/repo/redis', 'appendix/repo/redis',
],
},
'appendix/command/', 'appendix/command/',
'appendix/best_practices', 'appendix/best_practices',
'appendix/debug', 'appendix/debug',
'appendix/resources' 'appendix/resources',
],
},
{
title: "归档",
collapsable: false,
children: [
'archive/', 'archive/',
],
},
{ {
title: "Docker Machine", title: "Docker Machine",
collapsable: false, collapsable: false,

View File

@ -1,7 +1,7 @@
## 访 # 访
访 Linux `iptables` `iptables` Linux 访 Linux `iptables` `iptables` Linux
### 访 ## 访
访Linux 访Linux
```bash ```bash
@ -14,17 +14,17 @@ $sysctl -w net.ipv4.ip_forward=1
``` ```
Docker `--ip-forward=true`, Docker `ip_forward` 1 Docker `--ip-forward=true`, Docker `ip_forward` 1
### 访 ## 访
访 访
* `docker0` * `docker0`
* -- `iptables` * -- `iptables`
#### 访 ### 访
Docker dockerd iptables FORWARD `ACCEPT``DROP``--icc=true` `--icc=false` `--iptables=false` `iptables` Docker dockerd iptables FORWARD `ACCEPT``DROP``--icc=true` `--icc=false` `--iptables=false` `iptables`
`/etc/docker/daemon.json` `{"icc": false}` `/etc/docker/daemon.json` `{"icc": false}`
#### 访 ### 访
`-icc=false` 访 `--link=CONTAINER_NAME:ALIAS` 访 `-icc=false` 访 `--link=CONTAINER_NAME:ALIAS` 访
Docker 使 `icc=false --iptables=true` 访 Docker `iptables` Docker 使 `icc=false --iptables=true` 访 Docker `iptables`

View File

@ -1,4 +1,4 @@
## #
`docker0` `docker0`

View File

@ -1,4 +1,4 @@
## #
Docker 1.2.0 `/etc/hosts`, `/etc/hostname` `/etc/resolv.conf` Docker 1.2.0 `/etc/hosts`, `/etc/hostname` `/etc/resolv.conf`

View File

@ -1,4 +1,4 @@
## docker0 # docker0
Docker `docker0` `docker0` Docker `docker0` `docker0`

View File

@ -1,8 +1,8 @@
## #
### pipework ## pipework
Jérôme Petazzoni [pipework](https://github.com/jpetazzo/pipework) 的 shell 脚本,可以帮助用户在比较复杂的场景中完成容器的连接。 Jérôme Petazzoni [pipework](https://github.com/jpetazzo/pipework) 的 shell 脚本,可以帮助用户在比较复杂的场景中完成容器的连接。
### playground ## playground
Brandon Rhodes Docker [Python](https://github.com/brandon-rhodes/fopnp/tree/m/playground)包括路由、NAT 防火墙;以及一些提供 `HTTP` `SMTP` `POP` `IMAP` `Telnet` `SSH` `FTP` 的服务器。 Brandon Rhodes Docker [Python](https://github.com/brandon-rhodes/fopnp/tree/m/playground)包括路由、NAT 防火墙;以及一些提供 `HTTP` `SMTP` `POP` `IMAP` `Telnet` `SSH` `FTP` 的服务器。

View File

@ -1,8 +1,8 @@
## 宿 # 宿
访访 访访
### 访 ## 访
NAT IP 使 `iptables` NAT IP 使 `iptables`
@ -19,7 +19,7 @@ MASQUERADE all -- 172.17.0.0/16 !172.17.0.0/16
`172.17.0.0/16` MASQUERADE SNAT `172.17.0.0/16` MASQUERADE SNAT
### 访 ## 访
访 `docker run` `-p` `-P` 访 `docker run` `-p` `-P`

View File

@ -1,4 +1,4 @@
## #
Docker `docker0` Docker `docker0`

View File

@ -1,4 +1,4 @@
## #
Docker Docker

View File

@ -1,12 +1,12 @@
## [CentOS](https://hub.docker.com/_/centos) # [CentOS](https://hub.docker.com/_/centos)
### ##
[CentOS](https://en.wikipedia.org/wiki/CentOS) 是流行的 Linux 发行版,其软件包大多跟 RedHat 系列保持一致。 [CentOS](https://en.wikipedia.org/wiki/CentOS) 是流行的 Linux 发行版,其软件包大多跟 RedHat 系列保持一致。
`https://hub.docker.com/_/centos` CentOS 5 ~ 8 `https://hub.docker.com/_/centos` CentOS 5 ~ 8
### 使 ## 使
CentOS CentOS
@ -15,6 +15,6 @@ $ docker run --name centos -it centos bash
bash-4.2# bash-4.2#
``` ```
### Dockerfile ## Dockerfile
https://github.com/docker-library/docs/tree/master/centos 查看。 https://github.com/docker-library/docs/tree/master/centos 查看。

View File

@ -1,12 +1,12 @@
## [MongoDB](https://hub.docker.com/_/mongo/) # [MongoDB](https://hub.docker.com/_/mongo/)
### ##
[MongoDB](https://en.wikipedia.org/wiki/MongoDB) 是开源的 NoSQL 数据库实现。 [MongoDB](https://en.wikipedia.org/wiki/MongoDB) 是开源的 NoSQL 数据库实现。
`https://hub.docker.com/_/mongo/` MongoDB 2.x ~ 4.x `https://hub.docker.com/_/mongo/` MongoDB 2.x ~ 4.x
### 使 ## 使
`27017` `27017`
@ -29,6 +29,6 @@ $ docker run -it --rm \
sh -c 'exec mongo "$MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT/test"' sh -c 'exec mongo "$MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT/test"'
``` ```
### Dockerfile ## Dockerfile
https://github.com/docker-library/docs/tree/master/mongo 查看。 https://github.com/docker-library/docs/tree/master/mongo 查看。

View File

@ -1,12 +1,12 @@
## [MySQL](https://hub.docker.com/_/mysql/) # [MySQL](https://hub.docker.com/_/mysql/)
### ##
[MySQL](https://en.wikipedia.org/wiki/MySQL) 是开源的关系数据库实现。 [MySQL](https://en.wikipedia.org/wiki/MySQL) 是开源的关系数据库实现。
`https://hub.docker.com/_/mysql/` MySQL 5.5 ~ 8.x `https://hub.docker.com/_/mysql/` MySQL 5.5 ~ 8.x
### 使 ## 使
`3306` `3306`
@ -29,6 +29,6 @@ $ docker run -it --rm \
sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"' sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
``` ```
### Dockerfile ## Dockerfile
https://github.com/docker-library/docs/tree/master/mysql 查看 https://github.com/docker-library/docs/tree/master/mysql 查看

View File

@ -1,12 +1,12 @@
## [Nginx](https://hub.docker.com/_/nginx/) # [Nginx](https://hub.docker.com/_/nginx/)
### ##
[Nginx](https://en.wikipedia.org/wiki/Nginx) 是开源的高效的 Web 服务器实现,支持 HTTP、HTTPS、SMTP、POP3、IMAP 等协议。 [Nginx](https://en.wikipedia.org/wiki/Nginx) 是开源的高效的 Web 服务器实现,支持 HTTP、HTTPS、SMTP、POP3、IMAP 等协议。
`https://hub.docker.com/_/nginx/` Nginx 1.0 ~ 1.17.x `https://hub.docker.com/_/nginx/` Nginx 1.0 ~ 1.17.x
### 使 ## 使
@ -43,6 +43,6 @@ $ docker run -d \
nginx nginx
``` ```
### Dockerfile ## Dockerfile
https://github.com/docker-library/docs/tree/master/nginx 查看。 https://github.com/docker-library/docs/tree/master/nginx 查看。

View File

@ -1,12 +1,12 @@
## [Node.js](https://hub.docker.com/_/node/) # [Node.js](https://hub.docker.com/_/node/)
### ##
[Node.js](https://en.wikipedia.org/wiki/Node.js) 是基于 JavaScript 的可扩展服务端和网络软件开发平台。 [Node.js](https://en.wikipedia.org/wiki/Node.js) 是基于 JavaScript 的可扩展服务端和网络软件开发平台。
`https://hub.docker.com/_/node/` Node.js 0.10 ~ 12.x `https://hub.docker.com/_/node/` Node.js 0.10 ~ 12.x
### 使 ## 使
Dockerfile Dockerfile
@ -35,6 +35,6 @@ $ docker run -it --rm \
node your-daemon-or-script.js node your-daemon-or-script.js
``` ```
### Dockerfile ## Dockerfile
https://github.com/docker-library/docs/tree/master/node 查看。 https://github.com/docker-library/docs/tree/master/node 查看。

View File

@ -1,12 +1,12 @@
## [PHP](https://hub.docker.com/_/php/) # [PHP](https://hub.docker.com/_/php/)
### ##
[PHP](https://en.wikipedia.org/wiki/php)Hypertext Preprocessor 超文本预处理器的字母缩写)是一种被广泛应用的开放源代码的多用途脚本语言,它可嵌入到 HTML 中,尤其适合 web 开发。 [PHP](https://en.wikipedia.org/wiki/php)Hypertext Preprocessor 超文本预处理器的字母缩写)是一种被广泛应用的开放源代码的多用途脚本语言,它可嵌入到 HTML 中,尤其适合 web 开发。
`https://hub.docker.com/_/php/` PHP 5.x ~ 7.x `https://hub.docker.com/_/php/` PHP 5.x ~ 7.x
### 使 ## 使
PHP PHP
@ -14,6 +14,6 @@
$ docker run -it --rm -v "$PWD":/app -w /app php:alpine php your-script.php $ docker run -it --rm -v "$PWD":/app -w /app php:alpine php your-script.php
``` ```
### Dockerfile ## Dockerfile
https://github.com/docker-library/docs/tree/master/php 查看。 https://github.com/docker-library/docs/tree/master/php 查看。

View File

@ -1,12 +1,12 @@
## [Redis](https://hub.docker.com/_/redis/) # [Redis](https://hub.docker.com/_/redis/)
### ##
[Redis](https://en.wikipedia.org/wiki/Redis) 是开源的内存 Key-Value 数据库实现。 [Redis](https://en.wikipedia.org/wiki/Redis) 是开源的内存 Key-Value 数据库实现。
`https://hub.docker.com/_/redis/` Redis 3.x ~ 5.x `https://hub.docker.com/_/redis/` Redis 3.x ~ 5.x
### 使 ## 使
`6379` `6379`
@ -37,6 +37,6 @@ $ docker run -it --rm \
sh -c 'exec redis-cli -h "$REDIS_PORT_6379_TCP_ADDR" -p "$REDIS_PORT_6379_TCP_PORT"' sh -c 'exec redis-cli -h "$REDIS_PORT_6379_TCP_ADDR" -p "$REDIS_PORT_6379_TCP_PORT"'
``` ```
### Dockerfile ## Dockerfile
https://github.com/docker-library/docs/tree/master/redis 查看。 https://github.com/docker-library/docs/tree/master/redis 查看。

View File

@ -1,12 +1,12 @@
## [Ubuntu](https://hub.docker.com/_/ubuntu/) # [Ubuntu](https://hub.docker.com/_/ubuntu/)
### ##
[Ubuntu](https://en.wikipedia.org/wiki/Ubuntu) 是流行的 Linux 发行版,其自带软件版本往往较新一些。 [Ubuntu](https://en.wikipedia.org/wiki/Ubuntu) 是流行的 Linux 发行版,其自带软件版本往往较新一些。
`https://hub.docker.com/_/ubuntu/` Ubuntu 12.04 ~ 19.04 `https://hub.docker.com/_/ubuntu/` Ubuntu 12.04 ~ 19.04
### 使 ## 使
Ubuntu Ubuntu
@ -15,6 +15,6 @@ $ docker run --name some-ubuntu -it ubuntu:18.04
root@523c70904d54:/# root@523c70904d54:/#
``` ```
### Dockerfile ## Dockerfile
https://github.com/docker-library/docs/tree/master/ubuntu 查看。 https://github.com/docker-library/docs/tree/master/ubuntu 查看。

View File

@ -1,12 +1,12 @@
## [WordPress](https://hub.docker.com/_/wordpress/) # [WordPress](https://hub.docker.com/_/wordpress/)
### ##
[WordPress](https://en.wikipedia.org/wiki/WordPress) 是开源的 Blog 和内容管理系统框架,它基于 PHP 和 MySQL。 [WordPress](https://en.wikipedia.org/wiki/WordPress) 是开源的 Blog 和内容管理系统框架,它基于 PHP 和 MySQL。
`https://hub.docker.com/_/wordpress/` WordPress 4.x ~ 5.x `https://hub.docker.com/_/wordpress/` WordPress 4.x ~ 5.x
### 使 ## 使
MySQL `80` MySQL `80`
@ -20,6 +20,6 @@ $ docker run --name some-wordpress --link some-mysql:mysql -d wordpress
* `WORDPRESS_DB_PASSWORD` mysql `MYSQL_ROOT_PASSWORD` * `WORDPRESS_DB_PASSWORD` mysql `MYSQL_ROOT_PASSWORD`
* `WORDPRESS_DB_NAME` `wordpress` * `WORDPRESS_DB_NAME` `wordpress`
### Dockerfile ## Dockerfile
https://github.com/docker-library/docs/tree/master/wordpress 查看。 https://github.com/docker-library/docs/tree/master/wordpress 查看。

View File

@ -1,6 +1,6 @@
## CentOS/Fedora # CentOS/Fedora
### CentOS ## CentOS
`CentOS` `Fedora` `Redhat` Linux `CentOS` `Fedora` `CentOS` `Fedora` `Redhat` Linux `CentOS` `Fedora`
@ -8,7 +8,7 @@
CentOSCommunity Enterprise Operating System `Red Hat Enterprise Linux` `CentOS` `Redhat Linux` 使 `CentOS` `Red Hat Enterprise Linux``CentOS` CentOSCommunity Enterprise Operating System `Red Hat Enterprise Linux` `CentOS` `Redhat Linux` 使 `CentOS` `Red Hat Enterprise Linux``CentOS`
#### 使 CentOS ### 使 CentOS
使 `docker search` `25` `CentOS` 使 `docker search` `25` `CentOS`
@ -32,13 +32,13 @@ Status: Downloaded newer image for centos:latest
CentOS Linux release 7.2.1511 (Core) CentOS Linux release 7.2.1511 (Core)
``` ```
### Fedora ## Fedora
![Fedora ](_images/fedora-logo.png) ![Fedora ](_images/fedora-logo.png)
`Fedora` `Fedora Project` `Linux` `Fedora` `Red Hat` `Red Hat Enterprise Linux` `Fedora` `Fedora Project` `Linux` `Fedora` `Red Hat` `Red Hat Enterprise Linux`
#### 使 Fedora ### 使 Fedora
使 `docker search` `2` `Fedora` 使 `docker search` `2` `Fedora`
@ -64,7 +64,7 @@ Status: Downloaded newer image for fedora:latest
Fedora release 24 (Twenty Four) Fedora release 24 (Twenty Four)
``` ```
### ##
* `Fedora` https://getfedora.org/ * `Fedora` https://getfedora.org/
* `Fedora` https://github.com/fedora-infra * `Fedora` https://github.com/fedora-infra

View File

@ -1,10 +1,10 @@
## #
使 `-d` 使 `-d`
使 `docker attach` `docker exec` 使 `docker exec` 使 `docker attach` `docker exec` 使 `docker exec`
### `attach` ## `attach`
使 `docker attach` 使 `docker attach`
@ -22,9 +22,9 @@ root@243c32535da7:/#
** stdin exit ** stdin exit
### `exec` ## `exec`
#### -i -t ### -i -t
`docker exec` `-i` `-t` `docker exec` `-i` `-t`

View File

@ -1,4 +1,4 @@
## #
Docker 宿 `-d` Docker 宿 `-d`

View File

@ -1,6 +1,6 @@
## #
### ##
使 `docker export` 使 `docker export`
```bash ```bash
@ -12,7 +12,7 @@ $ docker export 7691a814370e > ubuntu.tar
### ##
使 `docker import` 使 `docker import`

View File

@ -1,4 +1,4 @@
## #
使 `docker container rm` 使 `docker container rm`
@ -9,7 +9,7 @@ trusting_newton
`-f` Docker `SIGKILL` `-f` Docker `SIGKILL`
## #
`docker container ls -a` `docker container ls -a`

View File

@ -1,10 +1,10 @@
## #
`stopped` `stopped`
Docker Docker
### ##
`docker run` `docker run`
@ -45,7 +45,7 @@ bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr
* *
* *
### ##
`docker container start` `docker container start`

View File

@ -1,4 +1,4 @@
## #
使 `docker container stop` 使 `docker container stop`

View File

@ -1,6 +1,6 @@
## #
### ##
使 `--mount` 使 `--mount`
@ -33,7 +33,7 @@ $ docker run -d -P \
touch: new.txt: Read-only file system touch: new.txt: Read-only file system
``` ```
### ##
使 `web` 使 `web`
@ -56,7 +56,7 @@ $ docker inspect web
], ],
``` ```
### ##
`--mount` `--mount`

View File

@ -1,4 +1,4 @@
## #
`数据卷` 使 UFS `数据卷` 使 UFS
@ -12,7 +12,7 @@
>`数据卷` 使 Linux mount `数据卷` >`数据卷` 使 Linux mount `数据卷`
### ##
```bash ```bash
$ docker volume create my-vol $ docker volume create my-vol
@ -42,7 +42,7 @@ $ docker volume inspect my-vol
] ]
``` ```
### ##
`docker run` 使 `--mount` `数据卷` `docker run` `数据卷` `docker run` 使 `--mount` `数据卷` `docker run` `数据卷`
@ -57,7 +57,7 @@ $ docker run -d -P \
python app.py python app.py
``` ```
### ##
使 `web` 使 `web`
@ -82,7 +82,7 @@ $ docker inspect web
], ],
``` ```
### ##
```bash ```bash
$ docker volume rm my-vol $ docker volume rm my-vol

View File

@ -1,4 +1,4 @@
## etcd # etcd
使 [Docker Compose](../compose/) 3 `etcd` 使 [Docker Compose](../compose/) 3 `etcd`

View File

@ -1,4 +1,4 @@
## 使 etcdctl v2 # 使 etcdctl v2
`etcdctl` `etcd` `HTTP API` 便 `etcd` `etcdctl` `HTTP API` `etcdctl` `etcd` `HTTP API` 便 `etcd` `etcdctl` `HTTP API`
@ -46,14 +46,14 @@ GLOBAL OPTIONS:
--version, -v print the version --version, -v print the version
``` ```
### ##
CRUD REST Create CRUD REST Create
etcd `testkey` `/` `cluster1/node2/testkey` etcd `testkey` `/` `cluster1/node2/testkey`
*CRUD Create, Read, Update, Delete REST API * *CRUD Create, Read, Update, Delete REST API *
#### set ### set
```bash ```bash
$ etcdctl set /testdir/testkey "Hello world" $ etcdctl set /testdir/testkey "Hello world"
@ -66,7 +66,7 @@ Hello world
--swap-with-index '0' --swap-with-index '0'
``` ```
#### get ### get
```bash ```bash
$ etcdctl set testkey hello $ etcdctl set testkey hello
@ -87,7 +87,7 @@ Error: 100: Key not found (/testkey2) [1]
--consistent --consistent
``` ```
#### update ### update
```bash ```bash
$ etcdctl set testkey hello $ etcdctl set testkey hello
@ -107,7 +107,7 @@ Error: 100: Key not found (/testkey2) [1]
--ttl '0' 0 --ttl '0' 0
``` ```
#### rm ### rm
```bash ```bash
$ etcdctl rm testkey $ etcdctl rm testkey
@ -127,7 +127,7 @@ Error: 100: Key not found (/testkey2) [8]
--with-index '0' index --with-index '0' index
``` ```
#### mk ### mk
```bash ```bash
$ etcdctl mk /testdir/testkey "Hello world" $ etcdctl mk /testdir/testkey "Hello world"
@ -146,7 +146,7 @@ Error: 105: Key already exists (/testkey) [2]
--ttl '0' 0 --ttl '0' 0
``` ```
#### mkdir ### mkdir
```bash ```bash
$ etcdctl mkdir testdir $ etcdctl mkdir testdir
@ -162,7 +162,7 @@ Error: 105: Key already exists (/testdir) [7]
--ttl '0' 0 --ttl '0' 0
``` ```
#### setdir ### setdir
@ -171,14 +171,14 @@ Error: 105: Key already exists (/testdir) [7]
--ttl '0' 0 --ttl '0' 0
``` ```
#### updatedir ### updatedir
```bash ```bash
--ttl '0' 0 --ttl '0' 0
``` ```
#### rmdir ### rmdir
@ -189,7 +189,7 @@ $ etcdctl rmdir /dir
Error: 108: Directory not empty (/dir) [13] Error: 108: Directory not empty (/dir) [13]
``` ```
#### ls ### ls
@ -212,9 +212,9 @@ $ ./etcdctl ls dir
-p `/` -p `/`
``` ```
### ##
#### backup ### backup
etcd etcd
@ -222,7 +222,7 @@ $ ./etcdctl ls dir
--data-dir etcd --data-dir etcd
--backup-dir --backup-dir
``` ```
#### watch ### watch
退 退
testkey Hello world testkey Hello world
@ -237,7 +237,7 @@ Hello world
--after-index '0' index --after-index '0' index
--recursive --recursive
``` ```
#### exec-watch ### exec-watch
testkey testkey
@ -258,7 +258,7 @@ README.md
--recursive --recursive
``` ```
#### member ### member
listaddremove etcd etcd listaddremove etcd etcd
@ -269,7 +269,7 @@ $ etcdctl member list
ce2a822cea30bfca: name=default peerURLs=http://localhost:2380,http://localhost:7001 clientURLs=http://localhost:2379,http://localhost:4001 ce2a822cea30bfca: name=default peerURLs=http://localhost:2380,http://localhost:7001 clientURLs=http://localhost:2379,http://localhost:4001
``` ```
### ##
* `--debug` cURL * `--debug` cURL
* `--no-sync` * `--no-sync`
* `--output, -o 'simple'` (`simple` `json` json) * `--output, -o 'simple'` (`simple` `json` json)

View File

@ -1,4 +1,4 @@
## 使 etcdctl # 使 etcdctl
`etcdctl` `etcd` `HTTP API` 便 `etcd` `etcdctl` `HTTP API` `etcdctl` `etcd` `HTTP API` 便 `etcd` `etcdctl` `HTTP API`
@ -81,7 +81,7 @@ OPTIONS:
-w, --write-out="simple" set the output format (fields, json, protobuf, simple, table) -w, --write-out="simple" set the output format (fields, json, protobuf, simple, table)
``` ```
### ##
CRUD REST Create CRUD REST Create
@ -89,14 +89,14 @@ etcd 在键的组织上采用了层次化的空间结构(类似于文件系统
>CRUD Create, Read, Update, Delete REST API >CRUD Create, Read, Update, Delete REST API
#### put ### put
```bash ```bash
$ etcdctl put /testdir/testkey "Hello world" $ etcdctl put /testdir/testkey "Hello world"
OK OK
``` ```
#### get ### get
@ -114,7 +114,7 @@ hello
`--consistent` `--consistent`
#### del ### del
@ -123,9 +123,9 @@ $ etcdctl del testkey
1 1
``` ```
### ##
#### watch ### watch
@ -138,7 +138,7 @@ testkey
2 2
``` ```
#### member ### member
`list``add``update``remove` etcd etcd `list``add``update``remove` etcd etcd

View File

@ -1,10 +1,10 @@
## #
`etcd` `Go` [](https://github.com/etcd-io/etcd) 下载源代码自行编译,也可以下载编译好的二进制文件,甚至直接使用制作好的 `Docker` 镜像文件来体验。 `etcd` `Go` [](https://github.com/etcd-io/etcd) 下载源代码自行编译,也可以下载编译好的二进制文件,甚至直接使用制作好的 `Docker` 镜像文件来体验。
> etcd `3.4.x` > etcd `3.4.x`
### ##
[github.com/etcd-io/etcd/releases](https://github.com/etcd-io/etcd/releases/) 页面,用户可以选择需要的版本,或通过下载工具下载。 [github.com/etcd-io/etcd/releases](https://github.com/etcd-io/etcd/releases/) 页面,用户可以选择需要的版本,或通过下载工具下载。
@ -56,7 +56,7 @@ hello world
etcd etcd
### Docker ## Docker
`quay.io/coreos/etcd` `etcd` `2379` `2380` `quay.io/coreos/etcd` `etcd` `2379` `2380`
@ -84,7 +84,7 @@ quay.io/coreos/etcd:v3.4.0 \
`etcd` `etcd`
### macOS ## macOS
```bash ```bash
$ brew install etcd $ brew install etcd

View File

@ -1,4 +1,4 @@
## etcd # etcd
![](_images/etcd_logo.png) ![](_images/etcd_logo.png)

View File

@ -1,4 +1,4 @@
## 使 Dockerfile # 使 Dockerfile
`docker commit` Dockerfile `docker commit` Dockerfile
@ -23,7 +23,7 @@ RUN echo '<h1>Hello, Docker!</h1>' > /usr/share/nginx/html/index.html
Dockerfile `FROM` `RUN` Dockerfile `FROM` `RUN`
### FROM ## FROM
`nginx` `FROM` **** `Dockerfile` `FROM` `nginx` `FROM` **** `Dockerfile` `FROM`
@ -42,7 +42,7 @@ FROM scratch
[`swarm`](https://hub.docker.com/_/swarm/)、[`etcd`](https://quay.io/repository/coreos/etcd)。对于 Linux 下静态编译的程序来说,并不需要有操作系统提供运行时支持,所需的一切库都已经在可执行文件里了,因此直接 `FROM scratch` 会让镜像体积更加小巧。使用 [Go 语言](https://golang.org/) 开发的应用很多会使用这种方式来制作镜像,这也是为什么有人认为 Go 是特别适合容器微服务架构的语言的原因之一。 [`swarm`](https://hub.docker.com/_/swarm/)、[`etcd`](https://quay.io/repository/coreos/etcd)。对于 Linux 下静态编译的程序来说,并不需要有操作系统提供运行时支持,所需的一切库都已经在可执行文件里了,因此直接 `FROM scratch` 会让镜像体积更加小巧。使用 [Go 语言](https://golang.org/) 开发的应用很多会使用这种方式来制作镜像,这也是为什么有人认为 Go 是特别适合容器微服务架构的语言的原因之一。
### RUN ## RUN
`RUN` `RUN` `RUN` `RUN`
@ -102,7 +102,7 @@ RUN buildDeps='gcc libc6-dev make wget' \
Docker Docker
### ##
nginx Dockerfile Dockerfile nginx Dockerfile Dockerfile
@ -130,7 +130,7 @@ docker build [选项] <上下文路径/URL/->
`-t nginx:v3` `nginx:v2` `nginx:v2` `-t nginx:v3` `nginx:v2` `nginx:v2`
### Context ## Context
`docker build` `.``.` `Dockerfile` `Dockerfile` **** `docker build` `.``.` `Dockerfile` `Dockerfile` ****
@ -170,9 +170,9 @@ Sending build context to Docker daemon 2.048 kB
使 `Dockerfile` 使 `Dockerfile`
### `docker build` ## `docker build`
#### Git repo ### Git repo
`docker build` URL Git repo `docker build` URL Git repo
@ -189,7 +189,7 @@ aed15891ba52: Already exists
Git repo `master` `/11.1/` Docker `git clone` Git repo `master` `/11.1/` Docker `git clone`
#### tar ### tar
```bash ```bash
$ docker build http://server/context.tar.gz $ docker build http://server/context.tar.gz
@ -197,7 +197,7 @@ $ docker build http://server/context.tar.gz
URL Git repo `tar` Docker URL Git repo `tar` Docker
#### Dockerfile ### Dockerfile
```bash ```bash
docker build - < Dockerfile docker build - < Dockerfile
@ -211,7 +211,7 @@ cat Dockerfile | docker build -
`Dockerfile` Dockerfile `COPY` `Dockerfile` Dockerfile `COPY`
#### ###
```bash ```bash
$ docker build - < context.tar.gz $ docker build - < context.tar.gz

View File

@ -1,8 +1,7 @@
# commit
> [](../container) > [](../container)
## commit
`docker commit` 使 `docker commit` 使 `Dockerfile` `docker commit` 使 `docker commit` 使 `Dockerfile`
`docker run` 使 Docker Hub 使 `docker run` 使 Docker Hub 使
@ -120,7 +119,7 @@ docker run --name web2 -d -p 81:80 nginx:v2
使 `docker commit` 使 `docker commit`
### `docker commit` ## `docker commit`
使 `docker commit` 使 使 `docker commit` 使

View File

@ -1,3 +1,3 @@
## Dockerfile # Dockerfile
`FROM``RUN` `COPY`, `ADD` `Dockerfile` `FROM``RUN` `COPY`, `ADD` `Dockerfile`

View File

@ -1,4 +1,4 @@
## #
Docker Docker

View File

@ -1,4 +1,4 @@
## #
使 `docker image ls` 使 `docker image ls`
@ -17,7 +17,7 @@ ubuntu latest f753707788c5 4 weeks ago
** ID** **** `ubuntu:18.04` `ubuntu:latest` ID ** ID** **** `ubuntu:18.04` `ubuntu:latest` ID
### ##
Docker Hub `ubuntu:18.04` `127 MB` [Docker Hub](https://hub.docker.com/r/library/ubuntu/tags/) 显示的却是 `50 MB`。这是因为 Docker Hub 中显示的体积是压缩后的体积。在镜像下载和上传过程中镜像是保持着压缩状态的,因此 Docker Hub 所显示的大小是网络传输中更关心的流量大小。而 `docker image ls` 显示的是镜像下载到本地后,展开的大小,准确说,是展开后的各层所占空间的总和,因为镜像到本地后,查看空间的时候,更关心的是本地磁盘空间占用的大小。 Docker Hub `ubuntu:18.04` `127 MB` [Docker Hub](https://hub.docker.com/r/library/ubuntu/tags/) 显示的却是 `50 MB`。这是因为 Docker Hub 中显示的体积是压缩后的体积。在镜像下载和上传过程中镜像是保持着压缩状态的,因此 Docker Hub 所显示的大小是网络传输中更关心的流量大小。而 `docker image ls` 显示的是镜像下载到本地后,展开的大小,准确说,是展开后的各层所占空间的总和,因为镜像到本地后,查看空间的时候,更关心的是本地磁盘空间占用的大小。
@ -35,7 +35,7 @@ Local Volumes 9 0 652.2MB
Build Cache 0B 0B Build Cache 0B 0B
``` ```
### ##
`<none>` `<none>`
@ -57,7 +57,7 @@ REPOSITORY TAG IMAGE ID CREATED
$ docker image prune $ docker image prune
``` ```
### ##
Docker ****使 `docker image ls` `-a` Docker ****使 `docker image ls` `-a`
@ -67,7 +67,7 @@ $ docker image ls -a
### ##
`docker image ls` `docker image ls` `docker image ls` `docker image ls`
@ -106,7 +106,7 @@ $ docker image ls -f label=com.example.version=0.1
... ...
``` ```
### ##
`docker image ls` `docker image ls` ID `docker image rm` `-q` `docker image ls` `docker image ls` ID `docker image rm` `-q`

View File

@ -1,4 +1,4 @@
## Docker -- docker manifest # Docker -- docker manifest
使 Docker 宿 `Linux x86_64` 使 `Linux x86_64` 使 Docker 宿 `Linux x86_64` 使 `Linux x86_64`
@ -109,11 +109,11 @@ $ docker manifest inspect golang:alpine
使 `$ docker manifest` `manifest` Docker Hub 使 `$ docker manifest` `manifest` Docker Hub
### ##
`Linux x86_64` `username/x8664-test` `Linux arm64v8` `username/arm64v8-test` Docker Hub `Linux x86_64` `username/x8664-test` `Linux arm64v8` `username/arm64v8-test` Docker Hub
### `manifest` ## `manifest`
```bash ```bash
# $ docker manifest create MANIFEST_LIST MANIFEST [MANIFEST...] # $ docker manifest create MANIFEST_LIST MANIFEST [MANIFEST...]
@ -124,7 +124,7 @@ $ docker manifest create username/test \
`manifest` `-a,--amend` `manifest` `-a,--amend`
### `manifest` ## `manifest`
```bash ```bash
# $ docker manifest annotate [OPTIONS] MANIFEST_LIST MANIFEST # $ docker manifest annotate [OPTIONS] MANIFEST_LIST MANIFEST
@ -139,13 +139,13 @@ $ docker manifest annotate username/test \
`manifest` `manifest`
### `manifest` ## `manifest`
```bash ```bash
$ docker manifest inspect username/test $ docker manifest inspect username/test
``` ```
### `manifest` ## `manifest`
Docker Hub Docker Hub
@ -153,11 +153,11 @@ $ docker manifest inspect username/test
$ docker manifest push username/test $ docker manifest push username/test
``` ```
### ##
`Linux x86_64` `Linux arm64v8` `$ docker run -it --rm username/test` `Linux x86_64` `Linux arm64v8` `$ docker run -it --rm username/test`
### ##
`manifest` `manifest`

View File

@ -1,10 +1,10 @@
## #
### ##
Docker 17.05 Docker Docker 17.05 Docker
#### Dockerfile ### Dockerfile
`Dockerfile` `Dockerfile`
@ -50,7 +50,7 @@ CMD ["./app"]
$ docker build -t go/helloworld:1 -f Dockerfile.one . $ docker build -t go/helloworld:1 -f Dockerfile.one .
``` ```
#### Dockerfile ### Dockerfile
`Dockerfile` `Dockerfile` `Dockerfile` `Dockerfile`
@ -119,7 +119,7 @@ go/helloworld 2 f7cf3465432c 22 seconds ago 6.47MB
go/helloworld 1 f55d3e16affc 2 minutes ago 295MB go/helloworld 1 f55d3e16affc 2 minutes ago 295MB
``` ```
### 使 ## 使
Docker v17.05 (`multistage builds`)使 `Dockerfile` Docker v17.05 (`multistage builds`)使 `Dockerfile`
@ -168,7 +168,7 @@ go/helloworld 1 f55d3e16affc 2 minutes ago 295MB
使 使
#### ###
使 `as` 使 `as`
@ -182,7 +182,7 @@ FROM golang:1.9-alpine as builder
$ docker build --target builder -t username/imagename:tag . $ docker build --target builder -t username/imagename:tag .
``` ```
#### ###
使 `COPY --from=0 /go/src/github.com/go/helloworld/app .` 使 `COPY --from=0 /go/src/github.com/go/helloworld/app .`

View File

@ -1,8 +1,8 @@
## Laravel # Laravel
> PHP > PHP
### ##
`Laravel` `Laravel` `Dockerfile` `.dockerignore` `laravel.conf` `Laravel` `Laravel` `Dockerfile` `.dockerignore` `laravel.conf`
@ -46,7 +46,7 @@ server {
} }
``` ```
### ##
@ -65,7 +65,7 @@ RUN cd /app \
&& npm run production && npm run production
``` ```
### Composer ## Composer
Composer Composer
@ -85,7 +85,7 @@ RUN cd /app \
--prefer-dist --prefer-dist
``` ```
### ##
@ -111,7 +111,7 @@ RUN cd ${LARAVEL_PATH} \
&& chmod -R 777 storage && chmod -R 777 storage
``` ```
### NGINX ## NGINX
```docker ```docker
FROM nginx:alpine as nginx FROM nginx:alpine as nginx
@ -122,7 +122,7 @@ COPY laravel.conf /etc/nginx/conf.d/
COPY --from=laravel ${LARAVEL_PATH}/public ${LARAVEL_PATH}/public COPY --from=laravel ${LARAVEL_PATH}/public ${LARAVEL_PATH}/public
``` ```
### Laravel Nginx ## Laravel Nginx
使 `docker build` 使 `docker build`
@ -132,7 +132,7 @@ $ docker build -t my/laravel --target=laravel .
$ docker build -t my/nginx --target=nginx . $ docker build -t my/nginx --target=nginx .
``` ```
### ##
Docker Docker
@ -156,11 +156,11 @@ $ docker run -it --rm --network=laravel -p 8080:80 my/nginx
> Laravel redisMySQL > Laravel redisMySQL
### ##
便使 **** `config` `secret` `Swarm mode` `Kubernetes` 便使 **** `config` `secret` `Swarm mode` `Kubernetes`
### ##
`Dockerfile` `Dockerfile`

View File

@ -1,8 +1,8 @@
## #
使 `Dockerfile` 使 `Dockerfile`
### rootfs ## rootfs
`docker import [选项] <文件>|<URL>|- [<仓库名>[:<标签>]]` `docker import [选项] <文件>|<URL>|- [<仓库名>[:<标签>]]`
@ -37,11 +37,11 @@ IMAGE CREATED CREATED BY SIZE
f477a6e18e98 About a minute ago 214.9 MB Imported from http://download.openvz.org/template/precreated/ubuntu-16.04-x86_64.tar.gz f477a6e18e98 About a minute ago 214.9 MB Imported from http://download.openvz.org/template/precreated/ubuntu-16.04-x86_64.tar.gz
``` ```
### `docker save` `docker load` ## `docker save` `docker load`
Docker `docker save` `docker load` Docker Registry 使 Docker Registry使 Docker Hub 使 Registry Docker `docker save` `docker load` Docker Registry 使 Docker Registry使 Docker Hub 使 Registry
#### ###
使 `docker save` 使 `docker save`

View File

@ -1,4 +1,4 @@
## #
[Docker Hub](https://hub.docker.com/explore/) 上有大量的高质量的镜像可以用,这里我们就说一下怎么获取这些镜像。 [Docker Hub](https://hub.docker.com/explore/) 上有大量的高质量的镜像可以用,这里我们就说一下怎么获取这些镜像。
@ -35,7 +35,7 @@ Status: Downloaded newer image for ubuntu:18.04
* Docker Hub [](/install/mirror.md) * * Docker Hub [](/install/mirror.md) *
### ##
`ubuntu:18.04` `bash` `ubuntu:18.04` `bash`

View File

@ -1,4 +1,4 @@
## #
使 `docker image rm` 使 `docker image rm`
@ -6,7 +6,7 @@
$ docker image rm [] <1> [<2> ...] $ docker image rm [] <1> [<2> ...]
``` ```
### ID ## ID
`<镜像>` `镜像短 ID``镜像长 ID``镜像名` `镜像摘要` `<镜像>` `镜像短 ID``镜像长 ID``镜像名` `镜像摘要`
@ -58,7 +58,7 @@ $ docker image rm node@sha256:b4f0e0bdeb578043c1ea6862f0d40cc4afe32a4a582f3be235
Untagged: node@sha256:b4f0e0bdeb578043c1ea6862f0d40cc4afe32a4a582f3be235a3b164422be228 Untagged: node@sha256:b4f0e0bdeb578043c1ea6862f0d40cc4afe32a4a582f3be235a3b164422be228
``` ```
### Untagged Deleted ## Untagged Deleted
`Untagged` `Deleted` ID `Untagged` `Deleted` ID
@ -68,7 +68,7 @@ Untagged: node@sha256:b4f0e0bdeb578043c1ea6862f0d40cc4afe32a4a582f3be235a3b16442
使 使
### docker image ls ## docker image ls
使 `docker image ls -q` 使 `docker image rm`使 使 `docker image ls -q` 使 `docker image rm`使
@ -86,7 +86,7 @@ $ docker image rm $(docker image ls -q -f before=mongo:3.2)
Linux Linux
### CentOS/RHEL ## CentOS/RHEL
> Docker CE 18.09 Docker CE 18.09 使 `overlay2` > Docker CE 18.09 Docker CE 18.09 使 `overlay2`

View File

@ -1,4 +1,4 @@
## DNS # DNS
DNS Docker 3 DNS Docker 3

View File

@ -1,10 +1,10 @@
## #
`Docker` 使使 `--link` 使 `Docker` 使使 `--link` 使
Docker Docker 使 `--link` Docker Docker 使 `--link`
### ##
Docker Docker
@ -14,7 +14,7 @@ $ docker network create -d bridge my-net
`-d` Docker `bridge` `overlay` `overlay` [Swarm mode](../swarm_mode/) `-d` Docker `bridge` `overlay` `overlay` [Swarm mode](../swarm_mode/)
### ##
`my-net` `my-net`
@ -62,6 +62,6 @@ PING busybox1 (172.19.0.2): 56 data bytes
`busybox1` `busybox2` `busybox1` `busybox2`
### Docker Compose ## Docker Compose
使 [Docker Compose](../compose) 使 [Docker Compose](../compose)

View File

@ -1,4 +1,4 @@
## 访 # 访
访 `-P` `-p` 访 `-P` `-p`
@ -25,7 +25,7 @@ $ docker logs -f nostalgic_morse
`-p` `ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort` `-p` `ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort`
### ##
使 `hostPort:containerPort` 5000 5000 使 `hostPort:containerPort` 5000 5000
@ -35,7 +35,7 @@ $ docker run -d -p 5000:5000 training/webapp python app.py
### ##
使 `ip:hostPort:containerPort` 使 localhost 127.0.0.1 使 `ip:hostPort:containerPort` 使 localhost 127.0.0.1
@ -43,7 +43,7 @@ $ docker run -d -p 5000:5000 training/webapp python app.py
$ docker run -d -p 127.0.0.1:5000:5000 training/webapp python app.py $ docker run -d -p 127.0.0.1:5000:5000 training/webapp python app.py
``` ```
### ##
使 `ip::containerPort` localhost 5000 使 `ip::containerPort` localhost 5000
@ -57,7 +57,7 @@ $ docker run -d -p 127.0.0.1::5000 training/webapp python app.py
$ docker run -d -p 127.0.0.1:5000:5000/udp training/webapp python app.py $ docker run -d -p 127.0.0.1:5000:5000/udp training/webapp python app.py
``` ```
### ##
使 `docker port` 使 `docker port`

View File

@ -1,10 +1,10 @@
## LinuxKit # LinuxKit
`LinuxKit` Docker Linux M 便 `LinuxKit` Docker Linux M 便
macOS Docker nginx Linux macOS Docker nginx Linux
### Linuxkit ## Linuxkit
```bash ```bash
$ brew tap linuxkit/linuxkit $ brew tap linuxkit/linuxkit
@ -12,7 +12,7 @@ $ brew tap linuxkit/linuxkit
$ brew install --HEAD linuxkit $ brew install --HEAD linuxkit
``` ```
### ##
```bash ```bash
$ git clone -b master --depth=1 https://github.com/linuxkit/linuxkit.git $ git clone -b master --depth=1 https://github.com/linuxkit/linuxkit.git
@ -20,7 +20,7 @@ $ git clone -b master --depth=1 https://github.com/linuxkit/linuxkit.git
$ cd linuxkit $ cd linuxkit
``` ```
### Linux ## Linux
LinuxKit `yaml` LinuxKit `yaml`
@ -40,7 +40,7 @@ LinuxKit 通过 `yaml` 文件配置。
$ linuxkit build linuxkit.yml $ linuxkit build linuxkit.yml
``` ```
### Linux ## Linux
Linux Linux

View File

@ -1,4 +1,4 @@
## #
Linux Linux
CPU IO 使 CPU IO 使

View File

@ -1,4 +1,4 @@
## Docker # Docker
Docker Docker root Docker Docker root
访 Docker Docker 访`/` `/host` 访 Docker Docker 访`/` `/host`

View File

@ -1,4 +1,4 @@
## #
Capability Linux 访 Capability Linux 访
Linux 2.2 Linux 2.2

View File

@ -1,4 +1,4 @@
## #
Docker LXC `docker run` Docker Docker LXC `docker run` Docker

View File

@ -1,4 +1,4 @@
## #
使 Docker TOMOYO, AppArmor, SELinux, GRSEC 使 Docker TOMOYO, AppArmor, SELinux, GRSEC
Docker Docker Docker Docker

View File

@ -1,4 +1,4 @@
## #
Docker 使 root Docker 使 root
使 Apparmor, SELinux, GRSEC 使 Apparmor, SELinux, GRSEC

View File

@ -1,4 +1,4 @@
## Swarm # Swarm
volume volume
@ -8,7 +8,7 @@
Swarm `redis` Swarm `redis`
### config ## config
`redis.conf` `redis.conf`
@ -24,7 +24,7 @@ port 6380
$ docker config create redis.conf redis.conf $ docker config create redis.conf redis.conf
``` ```
### config ## config
使 `docker config ls` `config` 使 `docker config ls` `config`
@ -35,7 +35,7 @@ ID NAME CREATED UPDATED
yod8fx8iiqtoo84jgwadp86yk redis.conf 4 seconds ago 4 seconds ago yod8fx8iiqtoo84jgwadp86yk redis.conf 4 seconds ago 4 seconds ago
``` ```
### redis ## redis
```bash ```bash
$ docker service create \ $ docker service create \

View File

@ -1,8 +1,8 @@
## Swarm # Swarm
[](overview.md) `Swarm` **** **** `Swarm` [](overview.md) `Swarm` **** **** `Swarm`
### ##
[`Docker Machine`](../machine) `Docker Machine` Docker 使 Docker [`Docker Machine`](../machine) `Docker Machine` Docker 使 Docker
@ -33,7 +33,7 @@ To add a manager to this swarm, run 'docker swarm join-token manager' and follow
> `docker swarm init` > `docker swarm init`
### ##
`Swarm` Docker `Swarm` Docker
@ -63,7 +63,7 @@ This node joined a swarm as a worker.
> `docker-machine create --help` `--swarm*` `Docker Swarm` `Swarm mode` > `docker-machine create --help` `--swarm*` `Docker Swarm` `Swarm mode`
### ##
`Swarm` `Swarm`

View File

@ -1,8 +1,8 @@
## #
使 `docker service` `Swarm` 使 `docker service` `Swarm`
### ##
`Swarm` `nginx` `Swarm` `nginx`
@ -12,7 +12,7 @@ $ docker service create --replicas 3 -p 80:80 --name nginx nginx:1.13.7-alpine
使 IP nginx 使 IP nginx
### ##
使 `docker service ls` `Swarm` 使 `docker service ls` `Swarm`
@ -44,7 +44,7 @@ nginx.1.pjfzd39buzlt@swarm2 | 10.255.0.2 - - [25/Nov/2017:02:10:27 +0000] "GE
nginx.1.pjfzd39buzlt@swarm2 | 2017/11/25 02:10:27 [error] 5#5: *1 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 10.255.0.2, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "192.168.99.101" nginx.1.pjfzd39buzlt@swarm2 | 2017/11/25 02:10:27 [error] 5#5: *1 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 10.255.0.2, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "192.168.99.101"
``` ```
### ##
使 `docker service scale` 使 `docker service scale`
@ -60,7 +60,7 @@ $ docker service scale nginx=5
$ docker service scale nginx=2 $ docker service scale nginx=2
``` ```
### ##
使 `docker service rm` `Swarm` 使 `docker service rm` `Swarm`

View File

@ -1,10 +1,10 @@
## #
`Swarm` 使 [`SwarmKit`](https://github.com/docker/swarmkit/) 构建的 Docker 引擎内置(原生)的集群管理和编排工具。 `Swarm` 使 [`SwarmKit`](https://github.com/docker/swarmkit/) 构建的 Docker 引擎内置(原生)的集群管理和编排工具。
使 `Swarm` 使 `Swarm`
### ##
Docker `Swarm` `Swarm` Docker `Swarm` (`node`) Docker `Swarm` `Swarm` Docker `Swarm` (`node`)
@ -18,7 +18,7 @@
![](https://docs.docker.com/engine/swarm/images/swarm-diagram.png) ![](https://docs.docker.com/engine/swarm/images/swarm-diagram.png)
### ##
`Task` `Swarm` `Task` `Swarm`

View File

@ -1,4 +1,4 @@
## SWarm mode # SWarm mode
[](deploy.md) 使 `nginx:1.13.7-alpine` `nginx` [](deploy.md) 使 `nginx:1.13.7-alpine` `nginx`
@ -24,7 +24,7 @@ $ docker service update \
`docker service update -h` `docker service update -h`
### 退 ## 退
`nginx` `nginx:1.13.12-alpine` 使退 `nginx` `nginx:1.13.12-alpine` 使退

View File

@ -1,4 +1,4 @@
## Swarm # Swarm
`密码``证书` volume `密码``证书` volume
@ -10,7 +10,7 @@ Docker 目前已经提供了 `secrets` 管理功能,用户可以在 Swarm 集
Swarm `mysql` `wordpress` Swarm `mysql` `wordpress`
### secret ## secret
使 `docker secret create` `secret` 使 `docker secret create` `secret`
@ -20,7 +20,7 @@ $ openssl rand -base64 20 | docker secret create mysql_password -
$ openssl rand -base64 20 | docker secret create mysql_root_password - $ openssl rand -base64 20 | docker secret create mysql_root_password -
``` ```
### secret ## secret
使 `docker secret ls` `secret` 使 `docker secret ls` `secret`
@ -32,7 +32,7 @@ l1vinzevzhj4goakjap5ya409 mysql_password 41 seconds ago 41 seconds
yvsczlx9votfw3l0nz5rlidig mysql_root_password 12 seconds ago 12 seconds ago yvsczlx9votfw3l0nz5rlidig mysql_root_password 12 seconds ago 12 seconds ago
``` ```
### MySQL ## MySQL

View File

@ -1,4 +1,4 @@
## Swarm 使 compose # Swarm 使 compose
使 `docker-compose.yml` `Swarm` 使 `compose` `docker-compose.yml` 使 `docker-compose.yml` `Swarm` 使 `compose` `docker-compose.yml`
@ -60,7 +60,7 @@ networks:
`Swarm` 使 `docker-compose.yml` `docker stack` `Swarm` 使 `docker-compose.yml` `docker stack`
### ##
使 `docker stack deploy` `-c` compose 使 `docker stack deploy` `-c` compose
@ -74,7 +74,7 @@ $ docker stack deploy -c docker-compose.yml wordpress
`任一节点IP` `WordPress` `任一节点IP` `WordPress` `任一节点IP` `WordPress` `任一节点IP` `WordPress`
### ##
```bash ```bash
$ docker stack ls $ docker stack ls
@ -82,7 +82,7 @@ NAME SERVICES
wordpress 3 wordpress 3
``` ```
### ##
使 `docker stack down` 使 `docker stack down`