Pull image from docker repository

        :params image: Image name
        :params progress_callback: A function that receive a log message about image download progress

def pull_image(self, image, progress_callback=None):
        """
        Pull image from docker repository

        :params image: Image name
        :params progress_callback: A function that receive a log message about image download progress
        """

        try:
            yield from self.query("GET", "images/{}/json".format(image))
            return  # We already have the image skip the download
        except DockerHttp404Error:
            pass

        if progress_callback:
            progress_callback("Pull {} from docker hub".format(image))
        response = yield from self.http_query("POST", "images/create", params={"fromImage": image}, timeout=None)
        # The pull api will stream status via an HTTP JSON stream
        content = ""
        while True:
            try:
                chunk = yield from response.content.read(1024)
            except aiohttp.ServerDisconnectedError:
                break
            if not chunk:
                break
            content += chunk.decode("utf-8")

            try:
                while True:
                    content = content.lstrip(" \r\n\t")
                    answer, index = json.JSONDecoder().raw_decode(content)
                    if "progress" in answer and progress_callback:
                        progress_callback("Pulling image {}:{}: {}".format(image, answer["id"], answer["progress"]))
                    content = content[index:]
            except ValueError:  # Partial JSON
                pass
        response.close()
        if progress_callback:
            progress_callback("Success pulling image {}".format(image))