mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 15:28:35 +00:00
Refactor and improve libcontainer and driver
Remove logging for now because it is complicating things Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
@@ -8,8 +8,11 @@ import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// CommandFactory takes the container's configuration and options passed by the
|
||||
// parent processes and creates an *exec.Cmd that will be used to fork/exec the
|
||||
// namespaced init process
|
||||
type CommandFactory interface {
|
||||
Create(container *libcontainer.Container, console, logFile string, syncFd uintptr, args []string) *exec.Cmd
|
||||
Create(container *libcontainer.Container, console string, syncFd uintptr, args []string) *exec.Cmd
|
||||
}
|
||||
|
||||
type DefaultCommandFactory struct{}
|
||||
@@ -17,13 +20,12 @@ type DefaultCommandFactory struct{}
|
||||
// Create will return an exec.Cmd with the Cloneflags set to the proper namespaces
|
||||
// defined on the container's configuration and use the current binary as the init with the
|
||||
// args provided
|
||||
func (c *DefaultCommandFactory) Create(container *libcontainer.Container, console, logFile string, pipe uintptr, args []string) *exec.Cmd {
|
||||
func (c *DefaultCommandFactory) Create(container *libcontainer.Container, console string, pipe uintptr, args []string) *exec.Cmd {
|
||||
// get our binary name so we can always reexec ourself
|
||||
name := os.Args[0]
|
||||
command := exec.Command(name, append([]string{
|
||||
"-console", console,
|
||||
"-pipe", fmt.Sprint(pipe),
|
||||
"-log", logFile,
|
||||
"init"}, args...)...)
|
||||
|
||||
command.SysProcAttr = &syscall.SysProcAttr{
|
||||
|
||||
Reference in New Issue
Block a user