如何设置docker容器的iP? [英] How to set a docker container's iP?

查看:153
本文介绍了如何设置docker容器的iP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我如何将容器的ip设置为特定的ip?我不想将桥设置为ips。我所得到的所有结果是将ips的范围设置到码头桥。

解决方案

您可以使用主机的现有IP,如下所示:

  docker运行-p 127.0.0.1:80:80图像等


Can somebody tell me how to set a container's ip to a specific one ? I dont want to set the bridge to set of ips. All the results i get in net is to set range of ips to the docker bridge.

解决方案

You can use an existing IP of the host like so:

docker run -p 127.0.0.1:80:80 image etc.

这篇关于如何设置docker容器的iP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆