func CheckImage(client DockerClient, taskInfo *mesos.TaskInfo) bool {
	images, err := client.ListImages(docker.ListImagesOptions{All: false})
	if err != nil {
		log.Errorf("Failure to list Docker images: %s", err.Error())
		return false
	}
	for _, img := range images {
		for _, tag := range img.RepoTags {
			if tag == taskInfo.Container.Docker.Image {
				return true
			}
		}
	}
	return false
}
Loop through all the images and see if we have one with a match
on this repo image:tag combination.
package container
import (
	"encoding/json"
	"fmt"
	"io"
	"regexp"
	"runtime"
	"strconv"
	"strings"
	retry "github.com/avast/retry-go"
	docker "github.com/fsouza/go-dockerclient"
	mesos "github.com/mesos/mesos-go/api/v1/lib"
	"github.com/pborman/uuid"
	log "github.com/sirupsen/logrus"
)
const (
	PullImageNumRetries = 5
	defaultCpuPeriod = 50000  
)
var portProtocolsTokenizer = regexp.MustCompile(`,\s?`)
type DockerClient interface {
	CreateContainer(opts docker.CreateContainerOptions) (*docker.Container, error)
	InspectContainer(id string) (*docker.Container, error)
	ListContainers(opts docker.ListContainersOptions) ([]docker.APIContainers, error)
	ListImages(docker.ListImagesOptions) ([]docker.APIImages, error)
	Logs(opts docker.LogsOptions) error
	PullImage(docker.PullImageOptions, docker.AuthConfiguration) error
	StartContainer(id string, hostConfig *docker.HostConfig) error
	StopContainer(id string, timeout uint) error
}