diff --git a/daemon/exec.go b/daemon/exec.go index 263d1d0fd9..c27171b4a1 100644 --- a/daemon/exec.go +++ b/daemon/exec.go @@ -18,8 +18,8 @@ import ( type ExecConfig struct { ProcessConfig execdriver.ProcessConfig - StreamConfig StreamConfig - OpenStdin bool + StreamConfig + OpenStdin bool } func (d *Daemon) ContainerExec(job *engine.Job) engine.Status { @@ -92,7 +92,6 @@ func (d *Daemon) ContainerExec(job *engine.Job) engine.Status { attachErr = d.Attach(&execConfig.StreamConfig, config.AttachStdin, false, config.Tty, cStdin, cStdinCloser, cStdout, cStderr) }() - log.Debugf("Exec Config is %+v\n", execConfig) go func() { err := container.Exec(execConfig) if err != nil { diff --git a/daemon/execdriver/native/driver.go b/daemon/execdriver/native/driver.go index 1d20de73ea..ef3dc95818 100644 --- a/daemon/execdriver/native/driver.go +++ b/daemon/execdriver/native/driver.go @@ -22,6 +22,7 @@ import ( "github.com/docker/libcontainer/cgroups/systemd" consolepkg "github.com/docker/libcontainer/console" "github.com/docker/libcontainer/namespaces" + _ "github.com/docker/libcontainer/namespaces/nsenter" "github.com/docker/libcontainer/system" ) diff --git a/daemon/execdriver/native/exec.go b/daemon/execdriver/native/exec.go index c02819e4ac..02d627d3ed 100644 --- a/daemon/execdriver/native/exec.go +++ b/daemon/execdriver/native/exec.go @@ -37,6 +37,7 @@ func nsenterExec() { } } +// TODO(vishh): Add support for running in priviledged mode and running as a different user. func (d *driver) Exec(c *execdriver.Command, processConfig *execdriver.ProcessConfig, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (int, error) { active := d.activeContainers[c.ID] if active == nil { diff --git a/runconfig/exec.go b/runconfig/exec.go index c37ca715bd..abbb985d7c 100644 --- a/runconfig/exec.go +++ b/runconfig/exec.go @@ -15,7 +15,6 @@ type ExecConfig struct { AttachStdout bool Detach bool Cmd []string - Hostname string } func ExecConfigFromJob(job *engine.Job) *ExecConfig { @@ -37,14 +36,11 @@ func ExecConfigFromJob(job *engine.Job) *ExecConfig { func ParseExec(cmd *flag.FlagSet, args []string) (*ExecConfig, error) { var ( - flPrivileged = cmd.Bool([]string{"#privileged", "-privileged"}, false, "Give extended privileges to this container") - flStdin = cmd.Bool([]string{"i", "-interactive"}, false, "Keep STDIN open even if not attached") - flTty = cmd.Bool([]string{"t", "-tty"}, false, "Allocate a pseudo-TTY") - flHostname = cmd.String([]string{"h", "-hostname"}, "", "Container host name") - flUser = cmd.String([]string{"u", "-user"}, "", "Username or UID") - flDetach = cmd.Bool([]string{"d", "-detach"}, false, "Detached mode: run command in the background") - execCmd []string - container string + flStdin = cmd.Bool([]string{"i", "-interactive"}, false, "Keep STDIN open even if not attached") + flTty = cmd.Bool([]string{"t", "-tty"}, false, "Allocate a pseudo-TTY") + flDetach = cmd.Bool([]string{"d", "-detach"}, false, "Detached mode: run command in the background") + execCmd []string + container string ) if err := cmd.Parse(args); err != nil { return nil, err @@ -56,12 +52,13 @@ func ParseExec(cmd *flag.FlagSet, args []string) (*ExecConfig, error) { } execConfig := &ExecConfig{ - User: *flUser, - Privileged: *flPrivileged, + // TODO(vishh): Expose '-u' flag once it is supported. + User: "", + // TODO(vishh): Expose '-p' flag once it is supported. + Privileged: false, Tty: *flTty, Cmd: execCmd, Container: container, - Hostname: *flHostname, Detach: *flDetach, }