Make nsinit a proper go pkg and add the main in another dir
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
52fa4de610
commit
5d71533d4e
7 changed files with 20 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package nsinit
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
@ -11,7 +11,8 @@ import (
|
|||
"syscall"
|
||||
)
|
||||
|
||||
func execinCommand(container *libcontainer.Container, nspid int, args []string) (int, error) {
|
||||
// ExecIn uses an existing pid and joins the pid's namespaces with the new command.
|
||||
func ExecIn(container *libcontainer.Container, nspid int, args []string) (int, error) {
|
||||
for _, ns := range container.Namespaces {
|
||||
if err := system.Unshare(namespaceMap[ns]); err != nil {
|
||||
return -1, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue