code: func (b *Builder) WriteImages() error {
  	path := "build/images.json"
  	tmp, err := os.Create(path + ".tmp")
  	if err != nil {
  		return err
  	}
  	defer tmp.Close()
  	if err := json.NewEncoder(tmp).Encode(b.artifacts); err != nil {
  		os.Remove(tmp.Name())
  		return err
  	}
  	return os.Rename(tmp.Name(), path)
  }
docs: // WriteImages writes the built images to build/images.json