New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having multiple NICs (network interfaces) on a Docker image before it boots #1824
Comments
I think I have a way to achieve that with pipework; I'll give it a try. |
That would be awesome, I tried but couldn't get pipework to work during
|
I know I am being impatient, but I was wondering if you got anywhere with this? |
This still needs a bit of work to be functional; tentatively scheduling it On Sat, Sep 14, 2013 at 2:46 PM, Mark Nijhof notifications@github.comwrote:
@jpetazzo https://twitter.com/jpetazzo |
Your wish has been granted: you can now run "pipework --wait" within a Does this solve your problem? [1] https://github.com/jpetazzo/pipework#wait-for-the-network-to-be-ready |
Using a script like pipeworks to do things that break the portability of containers (like adding a dependency in your app on dhcp or the presence of 2 NICs) should be a last resort when you really can't find a way to stay within the recommended use of docker. May I ask what your application does and why it needs 2 NICs? I'm also curious why you need dhcp for your application. @jpetazzo please don't forget to ask these questions and recommend your script as a last resort with a healthy warning on the downsides. Otherwise we will never get the user feedback we need and your custom script will always be necessary, which is bad for Docker. On Sat, Sep 21, 2013 at 12:00 PM, Jérôme Petazzoni
|
That said I'm curious if we need to add support for multi-NICs in the docker runtime. If there's interest we can start a discussion on the mailing list. On Sat, Sep 21, 2013 at 1:11 PM, Solomon Hykes notifications@github.com
|
Hi @jpetazzo thank you so much, I will test it tomorrow, but from the sound of it it would! @solomonstre I think you can say this is a last resort, I have asked on StackOverflow and on the Docker google group, I pointed to the SO post on Twitter and finally I opened a ticket @jpetazzo was the only one replying. So I think the Docker community should have heard about it. The use case is: Our client has two nic in their machines, one to manage the machine, reboot, install a new version of the software ect. And one nic that is used to do the actual work, this one is also externally visible. Our client works in the broadcast industry wants to create an extra layer of security by completely separating these two networks. Our software checks the nic's on startup and if they are not there it crashes (Erlang) thus the container never comes up, so we couldn't use the normal pipework's way of adding nic's. The machines are currently Ubuntu machines and upgrading specific parts of the setup is a pain, we would love to run Docker on these machines to help ease the pain. Currently we are talking about 30 machines, but this will be tripled in the future. I am happy to provide more details, and help test if this becomes part of Docker. Before @jpetazzo solution this was a show stopper for using Docker for this specific scenario. -Mark |
Sorry dhcp is because these machines will be started and stopped when needed, when they start they just get a free ip address assigned, then they tell the manager they are there, they get configured with the proper ip addresses and software version and reboot. So dhcp on these nic's will prevent duplicate ip's in the network. |
Solomon is right; I added a big fat warning to the Pipework documentation Mark, I'll see if I can add DHCP support; that way, you won't have to run On Sat, Sep 21, 2013 at 1:37 PM, Mark Nijhof notifications@github.comwrote:
@jpetazzo https://twitter.com/jpetazzo |
Thanks @jpetazzo. To clarify, I think pipeworks is super useful and please continue to point to it when it can help - but let's also gather all the information we can about which parts could be merged in upstream docker. For example would a dhcp plugin make sense to keep it out of the containers? It would be pretty easy to implement. On Sat, Sep 21, 2013 at 8:25 PM, Jérôme Petazzoni
|
Cheers @jpetazzo I think I am happy with the default setting for DHCP, in our case the machine only keeps the DHCP assigned address for maybe 10 minutes until someone has assigned it a new role after which it gets a new IP assigned (not from the DHCP). @solomonstre I didn't mean to sound mean, but pipework is solving a blocking issue for us to use Docker, I would love to have these things directly in Docker, but if that isn't possible due to time constraints or other reasons then I am happy. So I am not complaining at all. I would create a pull request if I thought I could implement it myself in Docker, but I am not sure I would be doing you a favor :-) I just want to be able to use Docker :-) |
Hi Mark. I added DHCP support: https://github.com/jpetazzo/pipework#dhcp Let me know if that helps. On Sun, Sep 22, 2013 at 12:53 PM, Mark Nijhof notifications@github.comwrote:
@jpetazzo https://twitter.com/jpetazzo |
@jpetazzo It sounds like it is about time to integrate pipework into docker. What do you think? |
+1. |
Milos Gajdos (I don't remember his github ID so I e-mailed him separetely) said he wanted to collaborate on a rewrite of Pipework to Go. |
Hi Guys, yeah I'll start looking into this stuff at some point today. I'm quite keen on the Pipework Go rewrite. I'll keep you in the loop! |
+1 for multi-nic binding at container boot time... my container has a requirement for a public/private network on separate eths... based on what my google-foo has produced thus far it appears I'm off to pipeworks. i see the port binding via |
👍 |
👍 For multiple nics with docker |
1 similar comment
👍 For multiple nics with docker |
For multiple nics with docker |
1 similar comment
For multiple nics with docker |
👍 for multiple nics as well. Something rancher would love to have. |
It's required to use bountysource for this issue, IMHO :) |
👍 For multiple nics with docker |
This is necessary because if doing a host network we cannot link to other containers. We need to be on the host network and at the same time link to other containers. |
👍 or +1 |
Has this work been completed? Any pointers to how to plumb multiple NICs inside docker containers? |
@vijayendrabvs close, but not quite yet. #13441 |
It is possible to have some tutorial or pointer about how to set this features ? |
+1 For multiple nics with docker I red the docker network docs then thought the same as @tangicolin . Should we still use jpetazzo/pipework ? |
@tangicolin @kujiy please refer to https://github.com/docker/docker/blob/master/docs/userguide/networking/work-with-networks.md.
This will start the container connected to multiple networks with multiple interfaces in the container on each of these networks. Will that satisfy your requirement ? |
I just gave this a try on docker 1.9.1 and it doesn't seem to work. The network connect on the not-yet-running container fails. Here's the error I get:
If I launch the container, and then connect, it works fine.
Is there anyway to do the connect before the container is running? |
Delete service info from cluster when service is disabled
I have a Docker image with ubuntu:latest and a few other dependencies. The script it starts automatically expects 2 NIC's eth0 (which is there by default) and eth1. Because this second NIC isn't there the script crashes and the container is stopped. So using Pipeworks doesn't work as the container isn't there anymore.
I tried adding this to the Dockerfile:
RUN echo "auto eth1" >> /etc/network/interfaces
RUN echo "iface eth1 inet dhcp" >> /etc/network/interfaces
But that didn't work either.
Is there a proper way to achieve this, or else a hack to begin with :-)
Maybe later having something like "NIC eth1 dhcp" in the Dockerfile would be cool.
-Mark
The text was updated successfully, but these errors were encountered: