mirror of
https://github.com/yeasy/docker_practice.git
synced 2025-10-21 14:21:33 +00:00
Update advanced_network
This commit is contained in:
@@ -46,7 +46,12 @@ DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:172.
|
||||
|
||||
注意:
|
||||
|
||||
* 这里的规则映射了 0.0.0.0,意味着将接受主机来自所有接口的流量。用户可以通过 `-p IP:host_port:container_port` 或 `-p
|
||||
IP::port` 来指定允许访问容器的主机上的 IP、接口等,以制定更严格的规则。
|
||||
* 这里的规则映射了 `0.0.0.0`,意味着将接受主机来自所有接口的流量。用户可以通过 `-p IP:host_port:container_port` 或 `-p IP::port` 来指定允许访问容器的主机上的 IP、接口等,以制定更严格的规则。
|
||||
|
||||
* 如果希望永久绑定到某个固定的 IP 地址,可以在 Docker 配置文件 `/etc/default/docker` 中指定 `DOCKER_OPTS="--ip=IP_ADDRESS"`,之后重启 Docker 服务即可生效。
|
||||
* 如果希望永久绑定到某个固定的 IP 地址,可以在 Docker 配置文件 `/etc/docker/daemon.json` 中添加如下内容。
|
||||
|
||||
```json
|
||||
{
|
||||
"ip": "0.0.0.0"
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user