Docker 이미지의 사용 가능한 태그와 특정 태그에 대한 다이제스트 정보를 가져오는 스크립트를 작성하려고 합니다. 하지만 GCP Artifact Registry와 Docker Hub에서 동일한 방식으로 태그나 매니페스트를 요청할 수 없다는 점에서 뭔가 놓치고 있는 것 같습니다.
GCP 레지스트리에 대한 문서를 찾았는데, 이는 기본적으로 Docker 레지스트리 문서를 가리키고 있으며, 이는 다시 CNCF Distribution 사양을 가리킵니다. 이로 인해 GCP가 v2 API 사양을 따르지 않는다고 생각하게 됩니다.
GCP의 인증 예제에서는 Docker Hub 레지스트리 API 사양과 다른 경로를 사용하여 태그를 가져옵니다. 테스트해본 결과, 다음 경로는 GCP에서 내 개인 이미지 태그 목록을 반환합니다:
swift
/v2/my-gcp-projects/my-app/image-name/tags/list
또한 GCP 예제는 CNCF Distribution 사양을 기반으로 올바른 API 경로를 사용하는 것처럼 보입니다.Stack Overflow
같은 접근 방식을 Docker Hub의 공개 debian 이미지에 적용해보았습니다. 여러 호스트를 사용했는데, 이는 구글 검색 후 찾은 정보에 따른 것입니다. 그러나 Docker Hub 레지스트리 API 호스트를 문서에서 찾을 수 없었습니다.Stack Overflow
bash
$ curl -s https://registry.hub.docker.com/v2/library/debian/tags/list | head
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"repository","Class":"","Name":"library/debian","Action":"pull"}]}]}​:contentReference[oaicite:20]{index=20}
:contentReference[oaicite:21]{index=21}
:contentReference[oaicite:22]{index=22}​:contentReference[oaicite:23]{index=23}
:contentReference[oaicite:24]{index=24}
:contentReference[oaicite:25]{index=25}
<html lang="en">
<head>
<meta charset="utf-8">
<title>404 : Docker</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
흥미로운 점은 인증 없이도 다음 경로를 사용할 수 있다는 것입니다. 하지만 경로를 보면 GCP와는 다른 API를 사용하는 것처럼 보입니다:Stack Overflow
bash
curl https://hub.docker.com/v2/namespaces/library/repositories/debian/tags
Docker Hub는 GCP 레지스트리와 동일한 API를 사용하지 않는 것인가요?
또한 Docker Hub에서 인증 없이 docker buildx imagetools inspect debian 명령을 실행할 수 있습니다. 그렇다면 공개 인덱스에 인증이 필요한가요, 아니면 그렇지 않은가요?
GCP 레지스트리와 Docker Hub, 그리고 가능하다면 다른 레지스트리에서도 동일한 API를 사용할 수 있는 방법이 있을까요? 제가 놓치고 있는 부분이 무엇인가요?