-
Notifications
You must be signed in to change notification settings - Fork 160
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
network_mode regression in sysbox 0.5 #518
Comments
@dictcp, thanks for reporting this. Will take a look at it asap. In the meantime, to simplify your setup as much as possible, can you please try to launch a regular docker container with a custom network? This works in my setup (Ubuntu-Focal & Sysbox v0.5.0) ...
Also, please provide the output of the PS: ARM64 is finally supported in v0.5.0 -- I know, it took longer than anticipated last time we chatted :-P. Hope that's still relevant for you. |
update: seems like it is output of #439
result
|
Re-run after workaround on #439:
the suggested command works for me as well. No error. I further convert those compose to docker command:
and either removing Seems like when the 2nd container reuse 1st container's network namespace, then error comes. |
and its
|
Hi @dictcp , Thanks for clear explanation. The problem is that in the following sequence:
The first container is not launched with Sysbox; in order for this to work, both containers must be launched with Sysbox:
The reason for this is that Sysbox containers always use the Linux user namespace for extra isolation (i.e., root in container = unprivileged user in host). The network namespace is a logically a "child" of the user namespace. Thus, in order for two containers to share a network (i.e., which requires sharing a network namespace), both containers must be in the same user-namespace too. If you launch the first container without Sysbox, then this won't be the case as that first container won't use the Linux user-namespace by default (unless Docker is configured in userns-remap mode). If you launch the first container with Sysbox, then Sysbox creates a user-namespace and network namespace for them. Then when the second container is launched, Sysbox realizes that the containers need to share the network, so it places that second container in the same user-namespace as the first one and then in the same network namespace too. I don't know how this worked before though, given that what I've described above is a Linux kernel requirement regarding user-namespace and network namespaces. Hope this helps. |
@ctalledo I have just double checked, the 0.4.1 installation was in userns-remap mode, per document suggested. and why those command works for me before. So seems it is my configuration issues. Let's close it first since it seems to be an expected behaviour. |
Thank you @dictcp, that makes sense. Thanks again for using Sysbox! |
Summary
the network_mode not working in recent sysbox 0.5. It works in sysbox 0.4
docker-compose.yaml
Execution error:
Environment:
userns-remap
not enabledThe text was updated successfully, but these errors were encountered: