code: func PrepareContainer(ctx context.Context, client *docker.Client, buildOpts *provision.BuildOptions, containerOpts *provision.ContainerOptions) (container *docker.Container, err error) {
  	img, err := provision.FnFindImage(client, buildOpts.GetImageName())
  	if err != nil && err != provision.ErrImageNotFound {
  		return
  	}
  
  	var image string
  	if img.ID == "" {
  		image, _, err = provision.FnImageBuild(client, buildOpts)
  		if err != nil {
  			return
  		}
  	} else {
  		image = buildOpts.GetImageName()
  	}
  
  	if containerOpts == nil {
  		containerOpts = &provision.ContainerOptions{}
  	}
  	containerOpts.Image = image
  	container, err = provision.FnContainer(client, *containerOpts)
  	return
  }
docs: // PrepareContainer build an image if necessary and run the container