Update the pause container section (#462)

* Update the pause container section

* Update pause-container.md

Co-authored-by: Jimmy Song <rootsongjc@gmail.com>
pull/466/head
Mervyn Zhan 2022-04-07 10:13:12 +08:00 committed by GitHub
parent bd6d52c43a
commit d1263f599d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 23 deletions

View File

@ -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 {