diff --git a/src/cli/utils.ts b/src/cli/utils.ts index 306c601..f7c4b24 100644 --- a/src/cli/utils.ts +++ b/src/cli/utils.ts @@ -495,16 +495,28 @@ export async function getDockerImageTags( repository: string, username: string = "sindrilabs", ): Promise { - const url = `https://hub.docker.com/v2/repositories/${username}/${repository}/tags/`; - const { - data: { results }, - } = await axios.get<{ - results: Array<{ - last_updated: string; - name: string; - tag_status: string; - }>; - }>(url); + let url: string | undefined = + `https://hub.docker.com/v2/repositories/${username}/${repository}/tags/?page_size=1`; + interface Result { + last_updated: string; + name: string; + tag_status: string; + } + interface Response { + count: number; + next?: string; + previous: string | null; + results: Result[]; + } + let results: Result[] = []; + + while (url) { + const response: { data: Response } = await axios.get(url); + + results = results.concat(response.data.results); + url = response.data.next; // Update the URL for the next request, or null if no more pages + } + return results .filter(({ tag_status }) => tag_status === "active") .filter(({ name }) => name !== "dev")