Import nsenter in docker.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
This commit is contained in:
Vishnu Kannan
2014-09-15 16:59:05 +00:00
parent 985d579586
commit e1cf95b593
4 changed files with 13 additions and 15 deletions
+2 -3
View File
@@ -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 {
+1
View File
@@ -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"
)
+1
View File
@@ -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 {