code: func (c *Calcium) BuildImage(ctx context.Context, opts *enginetypes.BuildOptions) (chan *types.BuildImageMessage, error) {
  	// Disable build API if scm not set
  	if c.source == nil {
  		return nil, types.ErrSCMNotSet
  	}
  	// select nodes
  	node, err := c.selectBuildNode(ctx)
  	if err != nil {
  		return nil, err
  	}
  	log.Infof("[BuildImage] Building image at pod %s node %s", node.Podname, node.Name)
  	// get refs
  	refs := node.Engine.BuildRefs(ctx, opts.Name, opts.Tags)
  	// support raw build
  	buildContent := opts.Tar
  	if opts.Builds != nil {
  		buildContent, err = node.Engine.BuildContent(ctx, c.source, opts)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	return c.doBuildImage(ctx, buildContent, node, refs)
  }
docs: // BuildImage will build image