네임스페이스의 저장소 목록 조회
네임스페이스의 저장소 목록 조회 (List repositories in a namespace)
Docker Hub API에서 지정한 네임스페이스(조직 또는 사용자) 안의 저장소(repository) 목록을 돌려주는 작업이에요. 공개 저장소는 누구나 볼 수 있고, 비공개 저장소는 적절한 인증과 권한이 필요해요.
출처: 문서
본문
GET 요청으로 네임스페이스 안의 저장소 목록을 조회합니다. bearerAuth 또는 익명 접근을 지원해요. 이 작업은 조직 액세스 토큰(OAT)에서 발급된 bearer 토큰을 받아요. 토큰은 필요한 리소스 접근 권한과 스코프를 가져야 합니다.
OAT 목록 동작
scope-repository-list 스코프가 있는 OAT는 비공개 저장소까지 포함한 모든 저장소를 봐요. 그 스코프가 없는 OAT는 공개 저장소만 봅니다. 이 필터링은 조용히 일어나요. 응답은 정상 200으로 돌아오고 비공개 저장소가 제외됐다는 표시가 없어요.
파라미터
| 파라미터 | 위치 | 설명 |
|---|---|---|
namespace |
path (필수) | 저장소를 조회할 네임스페이스 |
page |
query | 가져올 페이지 번호 (기본 1) |
page_size |
query | 페이지당 저장소 수 (기본 10, 최대 100) |
name |
query | 저장소 이름으로 필터(부분 일치) |
ordering |
query | 정렬 필드. 내림차순은 - 접두사 |
ordering으로 쓸 수 있는 값은 name/-name(이름), last_updated/-last_updated(최근 업데이트), pull_count/-pull_count(풀 횟수)예요.
응답 200
application/json 타입으로, 페이징 정보와 results 배열에 저장소 목록이 담겨요.
{
"count": 287,
"next": "https://hub.docker.com/v2/namespaces/docker/repositories?page=2&page_size=2",
"previous": null,
"results": [
{
"affiliation": "",
"categories": [
{
"name": "Languages & frameworks",
"slug": "languages-and-frameworks"
}
],
"content_types": [
"unrecognized",
"image"
],
"date_registered": "2015-05-19T21:13:35.937763Z",
"description": "Image for performing Docker build requests",
"is_private": false,
"last_modified": "2024-10-16T13:48:34.145251Z",
"last_updated": "2023-06-20T10:44:45.459826Z",
"media_types": [
"application/octet-stream",
"application/vnd.docker.container.image.v1+json",
"application/vnd.docker.distribution.manifest.v1+prettyjws"
],
"name": "highland_builder",
"namespace": "docker",
"pull_count": 15722123,
"repository_type": "image",
"star_count": 7,
"status": 1,
"status_description": "active",
"storage_size": 488723114800
}
]
}
count는 전체 결과 수,next/previous는 페이지 이동용 URL,results배열에 저장소 항목들이 들어가요.
오류 응답
400: 잘못된 요청 (예:Invalid ordering value)401: 인증 실패 (unauthorized)403: 권한 없음 (permission denied)404: 대상을 찾을 수 없음 (not found, 존재하지 않는 페이지 번호 등)
예시 요청
curl \
--request GET \
--header "Authorization: Bearer ***" \
--header 'Accept: application/json' \
'https://hub.docker.com/v2/namespaces/<NAMESPACE>/repositories'
더 알아보기
- 저장소 목록 응답 (list_repositories_response): 응답 구조를 자세히 확인해요.
- 저장소 정보 (repository_info):
results배열의 각 항목 구조를 살펴봐요.