为泊坞窗集装箱分配IP地址? [英] Assigning IP address to docker containers?

查看:163
本文介绍了为泊坞窗集装箱分配IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Docker的新人。是否可以将IP地址(从DHCP服务器)分配到在主机或虚拟机上运行的Docker容器?如果是的话,有人可以指向正确的方向吗?如果不是,这是容器方法的基本限制,还是只是Docker中的一个功能。

解决方案

警告 - Docker正在大力发展,所以对现有文档的确认是可取的。



网络元素是目前在 docker-dev 下讨论的元素之一,它看起来像长期整合正在考虑 libvirt 。所以要回答你的问题NET DHCP或某些东西可能没有按你想要的方式实现。



Docker的网络实现方式有一些描述在此博文。目前, CreateBridgeIface 中的一组IP范围=nofollow> network.go



同时你可能想要结帐管道系统,这是一种设计用于Docker用于各种网络配置的工具。这将允许您添加和修改容器上的IP地址,创建专用网络并将容器连接到物理接口。最后,它包装较低级别的工具,但您可能会发现使用管道更容易。


I'm new to Docker. Is it possible to assign an IP address (from a DHCP server) to Docker containers running on a host or VM? If yes, can someone point me in the correct direction. If no, is it a fundamental limitation of the container approach or it's just a feature that's not in Docker yet.

解决方案

Caveat - Docker is under heavy development so confirming against current docs is advisable.

The network element is one of those under current discussion on docker-dev, it looks like longer term integration with libvirt is being considered. So to answer your question NET DHCP or something is probably not implemented as you'd want.

Some of how Docker's networking is implemented is described in this blog post. Currently a set of IP ranges in CreateBridgeIface in network.go.

For the meanwhile you might want to checkout pipework which is a tool designed to be used with Docker for various network configuration. This will allow you to add and modify IP addresses on your container, create private networks and connect containers to a physical interface. In the end it's wrapping lower level tools but you might find using pipework easier.

这篇关于为泊坞窗集装箱分配IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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