-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Creating a network bridge? #201
Comments
@stuartpb There is no script. You can easily do this with |
Okay - what would such a script look like? |
On Fri, Aug 14, 2015 at 09:49:53AM -0700, Stuart P. Bentley wrote:
On the Open Containers list an hour ago, I suggested we post an
|
This sounds great - I'd do it as a whole new opencontainers/best-practices repo. |
For inspiration I would suggest checking out https://github.com/p8952/bocker/blob/master/bocker#L61 |
A pre-start hook like in #160 could be used to manipulate the network namespace to insert interfaces like in the script @mikedanese pointed above. |
The hook system will support you in adding networking to your containers. There are a few projects like https://github.com/jfrazelle/netns that do this. You can also provide a different network namespace for the container to do this but I think hooks are where most ppl are going today for network configuration in containers. |
@crosbymichael I'm having trouble accessing the internet from inside the container. I tried the My config.json is
|
@CarltonSemple how did you get on with this? I found netns had a bug where it said it was supposed to write to a bolt.db but never created this - it created a bridge but then "netns list" was throwing an error.. the repo has no way to create issues. 😕 |
@alexellis I have fixed this issue two months ago, but there is no new release up until now. |
That's good to know, thank you 👍 Do you use netns via a runc prestart/poststop hook or in some other way? I can barely find any documentation in containerd or netns for how to (create and attach) networks. Related question: I was searching the containerd codebase and rather terse docs on how to set a pre-start hook but can't find anything there. Do you have any suggestions on how to pragmatically configure the spec with containerd? Basically I'd like to have a pre-start hook to create the ns and then have the spec also bind to that. |
@alexellis Did you successfully use netns to create a network namespace in the container, I have a hook in prestart but it create the namespace in host, basically, it's runtime namespace but not container namespace |
How can I spawn a container with
runc
that has its own network bridge a la Docker? Is there a specific script I can use?The text was updated successfully, but these errors were encountered: