code: func (d *stiDocker) BuildImage(opts BuildImageOptions) error {
  	dockerOpts := dockertypes.ImageBuildOptions{
  		Tags:           []string{opts.Name},
  		NoCache:        true,
  		SuppressOutput: false,
  		Remove:         true,
  		ForceRemove:    true,
  	}
  	if opts.CGroupLimits != nil {
  		dockerOpts.Memory = opts.CGroupLimits.MemoryLimitBytes
  		dockerOpts.MemorySwap = opts.CGroupLimits.MemorySwap
  		dockerOpts.CgroupParent = opts.CGroupLimits.Parent
  	}
  	glog.V(2).Infof("Building container using config: %+v", dockerOpts)
  	resp, err := d.client.ImageBuild(context.Background(), opts.Stdin, dockerOpts)
  	if err != nil {
  		return err
  	}
  	defer resp.Body.Close()
  	// since can't pass in output stream to engine-api, need to copy contents of
  	// the output stream they create into our output stream
  	_, err = io.Copy(opts.Stdout, resp.Body)
  	if opts.Stdout != nil {
  		opts.Stdout.Close()
  	}
  	return err
  }
docs: // BuildImage builds the image according to specified options