Refactor to remove cmd from container
Pass the container's command via args Remove execin function and just look for an existing nspid file to join the namespace Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
663518ba66
commit
bb59129b2f
6 changed files with 55 additions and 55 deletions
|
@ -14,7 +14,7 @@ import (
|
|||
"syscall"
|
||||
)
|
||||
|
||||
func initCommand(container *libcontainer.Container, console string) error {
|
||||
func initCommand(container *libcontainer.Container, console string, args []string) error {
|
||||
rootfs, err := resolveRootfs()
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -72,7 +72,7 @@ func initCommand(container *libcontainer.Container, console string) error {
|
|||
return fmt.Errorf("chdir to %s %s", container.WorkingDir, err)
|
||||
}
|
||||
}
|
||||
if err := system.Exec(container.Command.Args[0], container.Command.Args[0:], container.Command.Env); err != nil {
|
||||
if err := system.Exec(args[0], args[0:], container.Env); err != nil {
|
||||
return fmt.Errorf("exec %s", err)
|
||||
}
|
||||
panic("unreachable")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue