diff --git a/phi/docker/resource/container.py b/phi/docker/resource/container.py index c6cd368c66..2375288a1d 100644 --- a/phi/docker/resource/container.py +++ b/phi/docker/resource/container.py @@ -123,7 +123,17 @@ def run_container(self, docker_client: DockerApiClient) -> Optional[Any]: try: _api_client: DockerClient = docker_client.api_client with Progress(transient=True) as progress: - task = progress.add_task("Downloading Image", total=None) # noqa: F841 + if self.force: + try: + pull_image_task = progress.add_task("Downloading Image", total=None) # noqa: F841 + _api_client.images.pull(self.image, platform=self.platform) + progress.update(pull_image_task, completed=True) + except Exception as pull_exc: + logger.warning(f"Could not pull image: {self.image}: {pull_exc}") + if self.force: + run_container_task = progress.add_task("Running Container", total=None) # noqa: F841 + else: + run_container_task = progress.add_task("Downloading Image", total=None) # noqa: F841 container_object = _api_client.containers.run( name=self.name, image=self.image, diff --git a/pyproject.toml b/pyproject.toml index 26c9e464b0..853d4c8a30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "phidata" -version = "2.0.29" +version = "2.0.30" description = "AI Toolkit for Engineers" requires-python = ">=3.7" readme = "README.md"