From f3d29695608d9ea9a3f92bcf872c62e158106919 Mon Sep 17 00:00:00 2001 From: Kimbro Staken Date: Mon, 8 Jul 2013 00:11:45 -0700 Subject: [PATCH 1/4] Override Entrypoint picked up from the base image that breaks run commands in builder --- buildfile.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/buildfile.go b/buildfile.go index 570a4eb72c..df413a61fc 100644 --- a/buildfile.go +++ b/buildfile.go @@ -108,7 +108,7 @@ func (b *buildFile) CmdRun(args string) error { } else { utils.Debugf("[BUILDER] Cache miss") } - + cid, err := b.run() if err != nil { return err @@ -279,6 +279,13 @@ func (b *buildFile) run() (string, error) { b.tmpContainers[c.ID] = struct{}{} fmt.Fprintf(b.out, " ---> Running in %s\n", utils.TruncateID(c.ID)) + // override the entry point that may have been picked up from the base image + c.Path = b.config.Cmd[0] + c.Args = b.config.Cmd[1:] + if err := c.ToDisk(); err != nil { + return "", err + } + //start the container hostConfig := &HostConfig{} if err := c.Start(hostConfig); err != nil { From 1d1d81b0bc52c6aff652f5515fd792f76e40f7c2 Mon Sep 17 00:00:00 2001 From: Kimbro Staken Date: Mon, 8 Jul 2013 00:18:47 -0700 Subject: [PATCH 2/4] Cleanup white space --- buildfile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildfile.go b/buildfile.go index df413a61fc..303baac318 100644 --- a/buildfile.go +++ b/buildfile.go @@ -108,7 +108,7 @@ func (b *buildFile) CmdRun(args string) error { } else { utils.Debugf("[BUILDER] Cache miss") } - + cid, err := b.run() if err != nil { return err From 2b5553144a9249bbfed9be2a181b051a66350cb1 Mon Sep 17 00:00:00 2001 From: Kimbro Staken Date: Mon, 8 Jul 2013 16:03:18 -0700 Subject: [PATCH 3/4] Removing the save to disk as it was not really necessary --- buildfile.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/buildfile.go b/buildfile.go index 303baac318..75e31dba70 100644 --- a/buildfile.go +++ b/buildfile.go @@ -281,10 +281,7 @@ func (b *buildFile) run() (string, error) { // override the entry point that may have been picked up from the base image c.Path = b.config.Cmd[0] - c.Args = b.config.Cmd[1:] - if err := c.ToDisk(); err != nil { - return "", err - } + c.Args = b.config.Cmd[1:] //start the container hostConfig := &HostConfig{} From f64dbdbe3a147f58d04b6c39c6469fdd97427098 Mon Sep 17 00:00:00 2001 From: Kimbro Staken Date: Mon, 8 Jul 2013 00:11:45 -0700 Subject: [PATCH 4/4] Override Entrypoint picked up from the base image that breaks run commands in builder --- buildfile.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildfile.go b/buildfile.go index 570a4eb72c..75e31dba70 100644 --- a/buildfile.go +++ b/buildfile.go @@ -279,6 +279,10 @@ func (b *buildFile) run() (string, error) { b.tmpContainers[c.ID] = struct{}{} fmt.Fprintf(b.out, " ---> Running in %s\n", utils.TruncateID(c.ID)) + // override the entry point that may have been picked up from the base image + c.Path = b.config.Cmd[0] + c.Args = b.config.Cmd[1:] + //start the container hostConfig := &HostConfig{} if err := c.Start(hostConfig); err != nil {