From bc086a9cd61b2d15fbef9db3cb53c7f3650fda48 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Fri, 7 Mar 2014 20:07:17 +0000 Subject: [PATCH] fix string in docker images Docker-DCO-1.1-Signed-off-by: Victor Vieux (github: vieux) --- server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server.go b/server.go index 024b8aa3c4..91c58f62e2 100644 --- a/server.go +++ b/server.go @@ -1011,7 +1011,11 @@ func (srv *Server) Containers(job *engine.Job) engine.Status { out.Set("Id", container.ID) out.SetList("Names", names[container.ID]) out.Set("Image", srv.runtime.repositories.ImageName(container.Image)) - out.Set("Command", fmt.Sprintf("%s %s", container.Path, strings.Join(container.Args, " "))) + if len(container.Args) > 0 { + out.Set("Command", fmt.Sprintf("\"%s %s\"", container.Path, strings.Join(container.Args, " "))) + } else { + out.Set("Command", fmt.Sprintf("\"%s\"", container.Path)) + } out.SetInt64("Created", container.Created.Unix()) out.Set("Status", container.State.String()) str, err := container.NetworkSettings.PortMappingAPI().ToListString()