docker預設網路有三種
bridge
host
none
--------------------常用指令--------------------
docker network create
docker network connect
docker network ls
docker network rm
docker network disconnect
docker network inspect
-----------------network啟動容器--------------
建立網路
docker network create dockerlnmp_default
查看網路
docker network inspect dockerlnmp_default
加入容器網路
docker network connect dockerlnmp_default
docker run --net=dockerlnmp_default -d --name mysql56 -p 3307:3306 -e MYSQL_ROOT_PASSWORD=123456789 dockerlnmp_mysql:latest
docker run --net=dockerlnmp_default -d --name php71 -p 9000:9000 -v /root/docker-lnmp/work/wwwroot:/etc/nginx/html/ -v /root/docker-lnmp/work/components/php71/config/php.ini:/usr/local/etc/php/php.ini -v /root/docker-lnmp/work/components/php71/log:/var/log dockerlnmp_php71:latest
docker run --net=dockerlnmp_default -d --name nginxweb -p 80:80 -v /root/docker-lnmp/work/wwwroot:/etc/nginx/html/ -v /root/docker-lnmp/work/components/nginx/config/conf.d:/etc/nginx/conf.d -v /root/docker-lnmp/work/components/nginx/log:/var/log/nginx dockerlnmp_nginx:latest