* Get supported platforms for a Docker image * Attempts to fetch manifest from registry to get platform information * @param imageName Image name in format "image:tag" or "registry/image:tag" * @returns Array of supported platform strings (e.g., ["linux/amd64", "linux/arm64"])
(imageName: string)
| 187 | * @returns Array of supported platform strings (e.g., ["linux/amd64", "linux/arm64"]) |
| 188 | */ |
| 189 | async getImagePlatforms(imageName: string): Promise<string[]> { |
| 190 | try { |
| 191 | // try to get manifest from registry using Docker Registry HTTP API V2 |
| 192 | return await this.getImagePlatformsFromRegistry(imageName); |
| 193 | } catch (error: any) { |
| 194 | // if we can't determine platforms, return empty array |
| 195 | return []; |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * Fetch image platforms from Docker registry using HTTP API V2 |
no test coverage detected