Check if Docker image exists locally. Args: image_name: Name of the Docker image to check Returns: True if image exists, False otherwise
(self, image_name: str)
| 189 | return False |
| 190 | |
| 191 | def check_image_exists(self, image_name: str) -> bool: |
| 192 | """Check if Docker image exists locally. |
| 193 | |
| 194 | Args: |
| 195 | image_name: Name of the Docker image to check |
| 196 | |
| 197 | Returns: |
| 198 | True if image exists, False otherwise |
| 199 | """ |
| 200 | try: |
| 201 | proc = RunningProcess( |
| 202 | ["docker", "images", "-q", image_name], |
| 203 | env=get_docker_env(), |
| 204 | auto_run=True, |
| 205 | ) |
| 206 | stdout_lines: list[str] = [] |
| 207 | with proc.line_iter(timeout=None) as it: |
| 208 | for line in it: |
| 209 | stdout_lines.append(line) |
| 210 | result_stdout = "\n".join(stdout_lines) |
| 211 | return bool(result_stdout.strip()) |
| 212 | except KeyboardInterrupt as ki: |
| 213 | handle_keyboard_interrupt(ki) |
| 214 | raise |
| 215 | except Exception: |
| 216 | return False |
| 217 | |
| 218 | def get_board_image_name(self, platform: str) -> str: |
| 219 | """Get Docker image name for board platform. |
no test coverage detected