Skip to content

Commit df94a6e

Browse files
committed
将所有的 "sh" 替换为 "bash"
这样更兼容 prism 避免报错。
1 parent d8be8f1 commit df94a6e

File tree

15 files changed

+140
-140
lines changed

15 files changed

+140
-140
lines changed

compose/commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
执行 `docker-compose [COMMAND] --help` 查看具体某个命令的使用说明。
66

77
基本的使用格式是
8-
```sh
8+
```bash
99
docker-compose [options] [COMMAND] [ARGS...]
1010
```
1111

@@ -33,7 +33,7 @@ docker-compose [options] [COMMAND] [ARGS...]
3333
### `kill`
3434

3535
通过发送 `SIGKILL` 信号来强制停止服务容器。支持通过参数来指定发送的信号,例如
36-
```sh
36+
```bash
3737
$ docker-compose kill -s SIGINT
3838
```
3939

compose/install.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
这种方式最为推荐。
77

88
执行命令。
9-
```sh
9+
```bash
1010
$ sudo pip install -U docker-compose
1111
```
1212

1313
安装成功后,可以查看 `docker-compose` 命令的用法。
14-
```sh
14+
```bash
1515
$ docker-compose -h
1616
Fast, isolated development environments using Docker.
1717

@@ -43,7 +43,7 @@ Commands:
4343
```
4444

4545
之后,可以添加 bash 补全命令。
46-
```sh
46+
```bash
4747
$ curl -L https://github.com/raw/docker/compose/1.2.0/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose
4848

4949
```

compose/usage.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#### index.py
2121

2222
编写一个 `index.py` 作为服务器文件,代码为
23-
```sh
23+
```bash
2424
#!/usr/bin/python
2525
#authors: yeasy.github.com
2626
#date: 2013-07-05
@@ -93,13 +93,13 @@ if __name__ == '__main__':
9393
9494
#### index.html
9595
生成一个临时的 `index.html` 文件,其内容会被 index.py 更新。
96-
```sh
96+
```bash
9797
$ touch index.html
9898
```
9999
100100
#### Dockerfile
101101
生成一个 Dockerfile,内容为
102-
```sh
102+
```bash
103103
FROM python:2.7
104104
WORKDIR /code
105105
ADD . /code
@@ -109,7 +109,7 @@ CMD python index.py
109109
110110
### haproxy 目录
111111
在其中生成一个 `haproxy.cfg` 文件,内容为
112-
```sh
112+
```bash
113113
global
114114
log 127.0.0.1 local0
115115
log 127.0.0.1 local1 notice
@@ -146,7 +146,7 @@ backend web_backends
146146
### docker-compose.yml
147147
编写 docker-compose.yml 文件,这个是 Compose 使用的主模板文件。内容十分简单,指定 3 个 web 容器,以及 1 个 haproxy 容器。
148148
149-
```sh
149+
```bash
150150
weba:
151151
build: ./web
152152
expose:
@@ -181,7 +181,7 @@ haproxy:
181181
182182
### 运行 compose 项目
183183
现在 compose-haproxy-web 目录长成下面的样子。
184-
```sh
184+
```bash
185185
compose-haproxy-web
186186
├── docker-compose.yml
187187
├── haproxy

compose/yaml_file.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
指定为镜像名称或镜像 ID。如果镜像在本地不存在,`Compose` 将会尝试拉去这个镜像。
1212

1313
例如:
14-
```sh
14+
```bash
1515
image: ubuntu
1616
image: orchardup/postgresql
1717
image: a4bc65fd
@@ -29,15 +29,15 @@ build: /path/to/build/dir
2929

3030
覆盖容器启动后默认执行的命令。
3131

32-
```sh
32+
```bash
3333
command: bundle exec thin -p 3000
3434
```
3535

3636
### `links`
3737

3838
链接到其它服务中的容器。使用服务名称(同时作为别名)或服务名称:服务别名 `(SERVICE:ALIAS)` 格式都可以。
3939

40-
```sh
40+
```bash
4141
links:
4242
- db
4343
- db:database
@@ -46,7 +46,7 @@ links:
4646

4747
使用的别名将会自动在服务容器中的 `/etc/hosts` 里创建。例如:
4848

49-
```sh
49+
```bash
5050
172.17.2.186 db
5151
172.17.2.186 database
5252
172.17.2.187 redis
@@ -88,7 +88,7 @@ ports:
8888

8989
仅可以指定内部端口为参数
9090

91-
```sh
91+
```bash
9292
expose:
9393
- "3000"
9494
- "8000"
@@ -98,7 +98,7 @@ expose:
9898

9999
卷挂载路径设置。可以设置宿主机路径 (`HOST:CONTAINER`) 或加上访问模式 (`HOST:CONTAINER:ro`)。
100100

101-
```sh
101+
```bash
102102
volumes:
103103
- /var/lib/mysql
104104
- cache/:/tmp/cache
@@ -109,7 +109,7 @@ volumes:
109109

110110
从另一个服务或容器挂载它的所有卷。
111111

112-
```sh
112+
```bash
113113
volumes_from:
114114
- service_name
115115
- container_name
@@ -138,7 +138,7 @@ environment:
138138

139139
如果有变量名称与 `environment` 指令冲突,则以后者为准。
140140

141-
```sh
141+
```bash
142142
env_file: .env
143143

144144
env_file:
@@ -149,14 +149,14 @@ env_file:
149149

150150
环境变量文件中每一行必须符合格式,支持 `#` 开头的注释行。
151151

152-
```sh
152+
```bash
153153
# common.env: Set Rails/Rack environment
154154
RACK_ENV=development
155155
```
156156

157157
### `extends`
158158
基于已有的服务进行扩展。例如我们已经有了一个 webapp 服务,模板文件为 `common.yml`
159-
```sh
159+
```bash
160160
# common.yml
161161
webapp:
162162
build: ./webapp
@@ -166,7 +166,7 @@ webapp:
166166
```
167167

168168
编写一个新的 `development.yml` 文件,使用 `common.yml` 中的 webapp 服务进行扩展。
169-
```sh
169+
```bash
170170
# development.yml
171171
web:
172172
extends:
@@ -188,7 +188,7 @@ db:
188188

189189
设置网络模式。使用和 `docker client``--net` 参数一样的值。
190190

191-
```sh
191+
```bash
192192
net: "bridge"
193193
net: "none"
194194
net: "container:[name or id]"
@@ -198,15 +198,15 @@ net: "host"
198198
### `pid`
199199
跟主机系统共享进程命名空间。打开该选项的容器可以相互通过进程 ID 来访问和操作。
200200

201-
```sh
201+
```bash
202202
pid: "host"
203203
```
204204

205205
### `dns`
206206

207207
配置 DNS 服务器。可以是一个值,也可以是一个列表。
208208

209-
```sh
209+
```bash
210210
dns: 8.8.8.8
211211
dns:
212212
- 8.8.8.8
@@ -215,7 +215,7 @@ dns:
215215

216216
### `cap_add, cap_drop`
217217
添加或放弃容器的 Linux 能力(Capabiliity)。
218-
```sh
218+
```bash
219219
cap_add:
220220
- ALL
221221

@@ -228,7 +228,7 @@ cap_drop:
228228

229229
配置 DNS 搜索域。可以是一个值,也可以是一个列表。
230230

231-
```sh
231+
```bash
232232
dns_search: example.com
233233
dns_search:
234234
- domain1.example.com

install/centos.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Docker 需要安装在 64 位的平台,并且内核版本不低于 3.10。 Cen
1010

1111
Docker 官方为了简化安装流程,提供了一套安装脚本,CentOS 系统上可以使用这套脚本安装:
1212

13-
```sh
13+
```bash
1414
curl -sSL https://get.docker.com/ | sh
1515
```
1616

@@ -20,13 +20,13 @@ curl -sSL https://get.docker.com/ | sh
2020

2121
#### 阿里云的安装脚本
2222

23-
```sh
23+
```bash
2424
curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -
2525
```
2626

2727
#### DaoCloud 的安装脚本
2828

29-
```sh
29+
```bash
3030
curl -sSL https://get.daocloud.io/docker | sh
3131
```
3232

@@ -36,14 +36,14 @@ curl -sSL https://get.daocloud.io/docker | sh
3636

3737
默认配置下,在 CentOS 使用 Docker 可能会碰到下面的这些警告信息:
3838

39-
```sh
39+
```bash
4040
WARNING: bridge-nf-call-iptables is disabled
4141
WARNING: bridge-nf-call-ip6tables is disabled
4242
```
4343

4444
添加内核配置参数以启用这些功能。
4545

46-
```sh
46+
```bash
4747
$ sudo tee -a /etc/sysctl.conf <<-EOF
4848
net.bridge.bridge-nf-call-ip6tables = 1
4949
net.bridge.bridge-nf-call-iptables = 1
@@ -52,7 +52,7 @@ EOF
5252

5353
然后重新加载 `sysctl.conf` 即可
5454

55-
```sh
55+
```bash
5656
$ sudo sysctl -p
5757
```
5858

@@ -62,7 +62,7 @@ $ sudo sysctl -p
6262

6363
执行下面的命令添加 `yum` 软件源。
6464

65-
```sh
65+
```bash
6666
$ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
6767
[dockerrepo]
6868
name=Docker Repository
@@ -77,14 +77,14 @@ EOF
7777

7878
更新 `yum` 软件源缓存,并安装 `docker-engine`
7979

80-
```sh
80+
```bash
8181
$ sudo yum update
8282
$ sudo yum install docker-engine
8383
```
8484

8585
#### 启动 Docker 引擎
8686

87-
```sh
87+
```bash
8888
$ sudo systemctl enable docker
8989
$ sudo systemctl start docker
9090
```
@@ -95,13 +95,13 @@ $ sudo systemctl start docker
9595

9696
建立 `docker` 组:
9797

98-
```sh
98+
```bash
9999
$ sudo groupadd docker
100100
```
101101

102102
将当前用户加入 `docker` 组:
103103

104-
```sh
104+
```bash
105105
$ sudo usermod -aG docker $USER
106106
```
107107

0 commit comments

Comments
 (0)