mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-29 05:05:39 +00:00
Add blank lines before headers
This commit is contained in:
@@ -7,6 +7,7 @@ Docker 网络提供了天然的隔离能力,不同网络之间的容器默认
|
||||
不同网络之间默认隔离,容器只能与同一网络中的容器直接通信:
|
||||
|
||||
```bash
|
||||
|
||||
## 创建两个网络
|
||||
|
||||
$ docker network create frontend
|
||||
@@ -42,6 +43,7 @@ ping: db: Name or service not known
|
||||
如果确实需要某个容器跨网络通信,可以将其同时连接到多个网络:
|
||||
|
||||
```bash
|
||||
|
||||
## 创建一个中间件容器,连接到两个网络
|
||||
|
||||
$ docker run -d --name api --network frontend myapi
|
||||
|
||||
Reference in New Issue
Block a user