Skip to content
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

Possible discrepancy between README and code regarding default network mode for rootless containers #93

Closed
lnde opened this issue Mar 18, 2021 · 2 comments · Fixed by #94

Comments

@lnde
Copy link

lnde commented Mar 18, 2021

Hi,

The README says that slirp4netns is the default network mode for rootless containers but that doesn't seem to be the case when testing and looking at the code. It seems the default is bridge even when running rootless containers. I stumbled into this when playing around with Nomad for the very first time so there's plenty of room for mistakes on my part.

Anyway my solution was to simply specify network_mode = "slirp4netns" in the config-section. This was tested on v0.2.0 release and 0502b79 (with bf21e15 reverted as it breaks with Podman 2.2.1), and I'd be happy to help test any patches.

Nomad v1.0.4
Podman 2.2.1

Documentation:
https://github.com/hashicorp/nomad-driver-podman/blame/main/README.md#L240
Code:

createOpts.ContainerNetworkConfig.NetNS.NSMode = api.Bridge

Thanks,
Andreas

@silvercrown07
Copy link

stumbled upon this issue as well, for me the setup is:
Nomad v1.0.4 (9294f35f9aa8dbb4acb6e85fa88e3e2534a3e41a)
podman version 3.0.1 (c640670e85c4aaaff92741691d6a854a90229d8d)
also used the same workaround, at first thought was due to #92 but seems the rootless attribute is only used for display purposes in nomad ui 😆

@towe75
Copy link
Collaborator

towe75 commented Mar 21, 2021

We can surely change the default mode to slirp4nets once the rootless check is fixed.
Thank you for the report!

towe75 added a commit that referenced this issue Mar 21, 2021
fix #92 parse rootless info correctly from podman 3.0.x struct
fix #93 use slirp4netns as default network mode if running rootless
Bump supported podman version in README to 3.0.x
towe75 added a commit that referenced this issue Mar 22, 2021
fix #92 parse rootless info correctly from podman 3.0.x struct
fix #93 use slirp4netns as default network mode if running rootless
Bump supported podman version in README to 3.0.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants