mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
Add NetMode, UTSMode and IPCMode
Allow kpod create/run to create contianers in different network namespaces, uts namespaces and IPC Namespaces. This patch just handles the simple join the host, or another containers namespaces. Lots more work needed to full integrate --net Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #64 Approved by: mheon
This commit is contained in:

committed by
Atomic Bot

parent
1f01faf437
commit
adf8809521
@ -1,6 +1,9 @@
|
||||
package libpod
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
spec "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
@ -54,6 +57,16 @@ func (r *Runtime) NewContainer(spec *spec.Spec, options ...CtrCreateOption) (c *
|
||||
}
|
||||
}()
|
||||
|
||||
if ctr.config.ShmDir == "" {
|
||||
ctr.config.ShmDir = filepath.Join(ctr.bundlePath(), "shm")
|
||||
if err := os.MkdirAll(ctr.config.ShmDir, 0700); err != nil {
|
||||
if !os.IsExist(err) {
|
||||
return nil, errors.Wrapf(err, "unable to create shm %q dir", ctr.config.ShmDir)
|
||||
}
|
||||
}
|
||||
ctr.config.Mounts = append(ctr.config.Mounts, ctr.config.ShmDir)
|
||||
}
|
||||
|
||||
// If the container is in a pod, add it to the pod
|
||||
if ctr.pod != nil {
|
||||
if err := ctr.pod.addContainer(ctr); err != nil {
|
||||
|
Reference in New Issue
Block a user