Try to figure out the most suitable shell to use

This commit is contained in:
Alfonso Acosta
2016-02-29 18:01:07 +00:00
parent 3e611f8986
commit 220db7656a

View File

@@ -99,7 +99,7 @@ func (r *registry) execContainer(containerID string, req xfer.Request) xfer.Resp
AttachStdout: true,
AttachStderr: true,
Tty: true,
Cmd: []string{"/bin/sh", "-c", "TERM=xterm exec /bin/sh"},
Cmd: []string{"/bin/sh", "-c", "TERM=xterm exec $( (type getent > /dev/null 2>&1 && getent passwd root | cut -d: -f7 2>/dev/null) || echo /bin/sh)"},
Container: containerID,
})
if err != nil {