code: func (d *Daemon) CheckRunningTaskImages(c *check.C) (interface{}, check.CommentInterface) {
  	cli := d.NewClientT(c)
  	defer cli.Close()
  
  	filterArgs := filters.NewArgs()
  	filterArgs.Add("desired-state", "running")
  
  	options := types.TaskListOptions{
  		Filters: filterArgs,
  	}
  
  	tasks, err := cli.TaskList(context.Background(), options)
  	assert.NilError(c, err)
  
  	result := make(map[string]int)
  	for _, task := range tasks {
  		if task.Status.State == swarm.TaskStateRunning && task.Spec.ContainerSpec != nil {
  			result[task.Spec.ContainerSpec.Image]++
  		}
  	}
  	return result, nil
  }
docs: // CheckRunningTaskImages returns the times each image is running as a task.