Read command from ContainerCreateRequest

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-12-12 18:56:12 +01:00
parent 1291b13125
commit f99c0a089c
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9

View file

@ -121,11 +121,21 @@ func (s *Server) createSandboxContainer(containerID string, containerName string
// here set it to be "rootfs". // here set it to be "rootfs".
specgen.SetRootPath("rootfs") specgen.SetRootPath("rootfs")
processArgs := []string{}
commands := containerConfig.GetCommand()
args := containerConfig.GetArgs() args := containerConfig.GetArgs()
if args == nil { if commands == nil && args == nil {
args = []string{"/bin/sh"} // TODO: override with image's config in #189
processArgs = []string{"/bin/sh"}
} }
specgen.SetProcessArgs(args) if commands != nil {
processArgs = append(processArgs, commands...)
}
if args != nil {
processArgs = append(processArgs, args...)
}
specgen.SetProcessArgs(processArgs)
cwd := containerConfig.GetWorkingDir() cwd := containerConfig.GetWorkingDir()
if cwd == "" { if cwd == "" {