docker: Error response from daemon: user specified IP address is supported only when connecting to networks with user configured subnets.解决

 

创建一个网络,网络指定IP运行容器报错,原因,docker中,只有使用 --subnet创建的网络才能指定静态IP

1
2
3
4
5
6
7
┌──[root@liruilongs.github.io]-[~]
└─$ docker network create load_balancing #创建一个网络
f9595e36d8a2fffd4e8570ad47439fa2a33864a357431c2abfad35d7d444c0c8
┌──[root@liruilongs.github.io]-[~]
└─$  docker run -itd -p 30000:80  --name=web1 --network=load_balancing --ip 172.18.0.2 httpd
3451c060c88b7d837d51ceab959d2faf805771a1b8e9ea2c186a91e4b492d3d8
docker: Error response from daemon: user specified IP address is supported only when connecting to networks with user configured subnets.

  

posted @   山河已无恙  阅读(3092)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示