Skip to content

Commit

Permalink
Update the pause container section (rootsongjc#462)
Browse files Browse the repository at this point in the history
* Update the pause container section

* Update pause-container.md

Co-authored-by: Jimmy Song <[email protected]>
  • Loading branch information
Mervyn Zhan and rootsongjc authored Apr 7, 2022
1 parent bd6d52c commit d1263f5
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions concepts/pause-container.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Pause容器
# Pause 容器

Pause 容器,又叫 Infra 容器,本文将探究该容器的作用与原理。

Expand Down Expand Up @@ -73,33 +73,13 @@ kubernetes 中的 pause 容器主要为每个业务容器提供以下功能:
我们首先在节点上运行一个 pause 容器。

```bash
docker run -d --name pause -p 8880:80 jimmysong/pause-amd64:3.0
docker run -d --name pause -p 8880:80 --ipc=shareable jimmysong/pause-amd64:3.0
```

然后再运行一个 nginx 容器,nginx 将为 `localhost:2368` 创建一个代理。

```bash
$ cat <<EOF >> nginx.conff
error_log stderr;
events { worker_connections 1024; }
http {
access_log /dev/stdout combined;
server {
listen 80 default_server;
server_name example.com www.example.com;
location / {
proxy_pass http://127.0.0.1:2368;
}
}
}
EOF
$ docker run -d --name nginx -v `pwd`/nginx.conf:/etc/nginx/nginx.conf --net=container:pause --ipc=container:pause --pid=container:pause nginx
```

然后再运行一个 nginx 容器,nginx 将为 `localhost:2368` 创建一个代理。

```bash
$ cat <<EOF >> nginx.conff
$ cat <<EOF >> nginx.conf
error_log stderr;
events { worker_connections 1024; }
http {
Expand Down

0 comments on commit d1263f5

Please sign in to comment.