builder: properly communicate onbuild trigger information during subsequent builds.

closes #8078
fixes #8078

/cc @tianon @tiborvass 
So the image actually gets produced instead of just returning the sha for “testbuildonbuildparent”.

MAINTAINER creates a layer so onbuild triggers get applied.

On Sep 23, 2014, at 2:04 PM, Tibor Vass <notifications@github.com> wrote:

> In integration-cli/docker_cli_build_test.go:
> 
> > @@ -2142,3 +2142,25 @@ func TestBuildEmptyCmd(t *testing.T) {
> >  	}
> >  	logDone("build - empty cmd")
> >  }
> > +
> > +func TestBuildOnBuildOutput(t *testing.T) {
> > +	name := "testbuildonbuildparent"
> > +	defer deleteImages(name)
> > +	if _, err := buildImage(name, "FROM busybox\nONBUILD RUN echo foo\n", true); err != nil {
> > +		t.Fatal(err)
> > +	}
> > +
> > +	childname := "testbuildonbuildchild"
> > +	defer deleteImages(childname)
> > +
> > +	_, out, err := buildImageWithOut(name, "FROM "+name+"\nMAINTAINER quux\n", true)
> why do we need MAINTAINER?
> 
> —
> Reply to this email directly or view it on GitHub.
>