From 7984b9129a11336a24a4daa60af4f4d7e5bbd0b0 Mon Sep 17 00:00:00 2001 From: Jeena Date: Thu, 28 May 2026 21:56:38 +0000 Subject: [PATCH] container: Pull fresh base image on update and drop unused constant --- agent-container.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/agent-container.py b/agent-container.py index b677179..a104018 100755 --- a/agent-container.py +++ b/agent-container.py @@ -27,7 +27,6 @@ class AgentContainer: IMAGE = "agent-container:latest" CONTAINER_PREFIX = "ac-" DATA_DIR_NAME = "agent-container" - PROJECT_ID_LEN = 12 START_TIMEOUT = 3.0 def __init__(self): @@ -215,7 +214,7 @@ class AgentContainer: == 0 ) - def build_image(self, no_cache: bool = False) -> None: + def build_image(self, no_cache: bool = False, pull: bool = False) -> None: logger.info( f"Building image '{self.IMAGE}' with user {self.host_username} ({self.host_uid}:{self.host_gid})" ) @@ -233,6 +232,8 @@ class AgentContainer: ] if no_cache: cmd.append("--no-cache") + if pull: + cmd.append("--pull") cmd.append(str(self.docker_context_dir)) self._run_cmd(cmd) @@ -297,7 +298,7 @@ class AgentContainer: stderr=subprocess.DEVNULL, ) logger.info("Rebuilding image with latest versions...") - self.build_image(no_cache=True) + self.build_image(no_cache=True, pull=True) logger.info("Update complete. Containers will be recreated on next run.") def purge(self) -> None: