diff options
author | Gabi Beyer <gabrielle.n.beyer@intel.com> | 2019-06-12 17:31:18 +0000 |
---|---|---|
committer | gabi beyer <gabrielle.n.beyer@intel.com> | 2019-07-30 23:28:52 +0000 |
commit | 80dcd4bebcdc8e280f6b43228561d09c194c328b (patch) | |
tree | 8cbea1af853ef8d095e35f7f5831d2609c3d24e4 /libpod/runtime_pod_infra_linux.go | |
parent | ef8834aeab8df79452709c13ffbd0041e7cf7e81 (diff) | |
download | podman-80dcd4bebcdc8e280f6b43228561d09c194c328b.tar.gz podman-80dcd4bebcdc8e280f6b43228561d09c194c328b.tar.bz2 podman-80dcd4bebcdc8e280f6b43228561d09c194c328b.zip |
rootless: Rearrange setup of rootless containers
In order to run Podman with VM-based runtimes unprivileged, the
network must be set up prior to the container creation. Therefore
this commit modifies Podman to run rootless containers by:
1. create a network namespace
2. pass the netns persistent mount path to the slirp4netns
to create the tap inferface
3. pass the netns path to the OCI spec, so the runtime can
enter the netns
Closes #2897
Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
Diffstat (limited to 'libpod/runtime_pod_infra_linux.go')
-rw-r--r-- | libpod/runtime_pod_infra_linux.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libpod/runtime_pod_infra_linux.go b/libpod/runtime_pod_infra_linux.go index da35b7f93..20b841296 100644 --- a/libpod/runtime_pod_infra_linux.go +++ b/libpod/runtime_pod_infra_linux.go @@ -95,7 +95,9 @@ func (r *Runtime) makeInfraContainer(ctx context.Context, p *Pod, imgName, imgID if isRootless { netmode = "slirp4netns" } - options = append(options, WithNetNS(p.config.InfraContainer.PortBindings, isRootless, netmode, networks)) + // PostConfigureNetNS should not be set since user namespace sharing is not implemented + // and rootless networking no longer supports post configuration setup + options = append(options, WithNetNS(p.config.InfraContainer.PortBindings, false, netmode, networks)) return r.newContainer(ctx, g.Config, options...) } |