code: func (b *Builder) FromImage(image *docker.Image, node *parser.Node) error {
  	SplitChildren(node, command.From)
  
  	b.RunConfig = *image.Config
  	b.Env = b.RunConfig.Env
  	b.RunConfig.Env = nil
  
  	// Check to see if we have a default PATH, note that windows won't
  	// have one as its set by HCS
  	if runtime.GOOS != "windows" && !hasEnvName(b.Env, "PATH") {
  		b.RunConfig.Env = append(b.RunConfig.Env, "PATH="+defaultPathEnv)
  	}
  
  	// Join the image onbuild statements into node
  	if image.Config == nil || len(image.Config.OnBuild) == 0 {
  		return nil
  	}
  	extra, err := ParseDockerfile(bytes.NewBufferString(strings.Join(image.Config.OnBuild, "\n")))
  	if err != nil {
  		return err
  	}
  	for _, child := range extra.Children {
  		switch strings.ToUpper(child.Value) {
  		case "ONBUILD":
  			return fmt.Errorf("Chaining ONBUILD via `ONBUILD ONBUILD` isn't allowed")
  		case "MAINTAINER", "FROM":
  			return fmt.Errorf("%s isn't allowed as an ONBUILD trigger", child.Value)
  		}
  	}
  	node.Children = append(extra.Children, node.Children...)
  	// Since we've processed the OnBuild statements, clear them from the runconfig state.
  	b.RunConfig.OnBuild = nil
  	return nil
  }
docs: // FromImage updates the builder to use the provided image (resetting RunConfig
  // and recording the image environment), and updates the node with any ONBUILD
  // statements extracted from the parent image.