diff --git a/daemon/exec.go b/daemon/exec.go index 263d1d0fd98fb09f48b1b82f2eb63913a5bf3825..c27171b4a1061753653ab87cc39939936e43612a 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 1d20de73ea79b442d3c21e74a3493d6651e33943..ef3dc95818fcfd32a4a2e8e4518a254806d260a1 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 c02819e4acb5422bf041a1888bf15330306a7eaf..02d627d3ed7ff32210788377dad1f5870ae09600 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 c37ca715bd11465b79438814b0c5f1fc0cdd6837..abbb985d7ce54803446c0f3b6036f169d91e1c50 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, }