容器启动报错:
user specified IP address is supported only when connecting to networks with user configured subnets
原因:
docker容器要指定IP,网络必须通过subnets创建
解决办法:
-
删除对应的网络,比如我们的网络是 my_net:
docker network rm my_net
-
Docker解决办法:
docker network create --driver bridge --subnet 172.40.1.0/24 --gateway 172.40.1.1 my_net
-
docker-compose解决办法: