Docker网络

vim /etc/docker/daemon.json
{
  "registry-mirrors": ["https://xxxxx.mirror.aliyuncs.com"],
  "insecure-registries":["127.0.0.1:3000"],
  "bip":"192.168.0.1/24"
}

# 所有网络
docker network ls
# 删除无用网络
docker network prune
# bridge网络详情
docker network inspect bridge
# 创建桥接网络,名称 test_bridge
docker network create --subnet=192.168.22.1/24 test_bridge
# 将容器(test_container)链接至桥接网络 (test_bridge)
docker network connect  test_bridge test_container
# 将容器(test_container)断开桥接网络 (test_bridge)
docker network disconnect  test_bridge  test_container
# 删除桥接网络 test_bridge
docker network rm test_bridge
# 重启容器 test_container
docker restart test_container
# 查看容器日志
docker logs -f --tail 100 test_container