一、概述
1.1、基础操作
查看网络列表【默认提供三种网络】:docker network ls
创建一个driver为bridge的网络:(默认创建的就是bridge):docker network create 自定义network名
删除:docker network rm 自定义networkID
查看网络信息: docker network inspect centos66-net
1.2、docker 镜像使用
利用--network启动容器提供服务:
docker network rm -f centos66-net docker network create centos66-net docker run -dit --privileged --name=centos66 --net=centos66-net centos:6.6 /bin/bash
二、更多命令
原文地址:Docker network
Command | Description |
docker network connect | Connect a container to a network |
docker network create | Create a network |
docker network disconnect | Disconnect a container from a network |
docker network inspect | Display detailed information on one or more networks |
docker network ls | List networks |
docker network prune | Remove all unused networks |
docker network rm | Remove one or more networks |
帮助:docker network create --help
反倒是