ns_linux.go 337 B

1234567891011121314
  1. package nsinit
  2. import (
  3. "github.com/dotcloud/docker/pkg/libcontainer"
  4. )
  5. // getNamespaceFlags parses the container's Namespaces options to set the correct
  6. // flags on clone, unshare, and setns
  7. func GetNamespaceFlags(namespaces libcontainer.Namespaces) (flag int) {
  8. for _, ns := range namespaces {
  9. flag |= ns.Value
  10. }
  11. return flag
  12. }