은 다음 API를 호출 : 그래서
{
"count": 139,
"next": "https://hub.docker.com/v2/repositories/library/?page=1&page_size=15",
"previous": null,
"results": [{
"user": "library",
"name": "nginx",
"namespace": "library",
"repository_type": "image",
"status": 1,
"description": "Official build of Nginx.",
"is_private": false,
"is_automated": false,
"can_edit": false,
"star_count": 5777,
"pull_count": 618674944,
"last_updated": "2017-04-06T16:35:19.178373Z",
"build_on_cloud": null
},
...
...
]
}
다음과 같은 뜻 :
https://hub.docker.com/v2/repositories/library/?page=1&page_size=15
기본 필터가 풀 카운트를 내림차순으로, 그것은 당신에게 다음과 같은 응답을 줄 것이다 도커 허브에 올려 놓은 상위 100 개의 도커 이미지를 제공합니다.
page_size
의 최대 크기는 100 (페이지 당 100)이며 count
은이 끝점에서 제공 할 수있는 최대 개수입니다 (모든 페이지에 대해). curl
및 jq
JSON 파서 예를 들어
:
curl -s "https://hub.docker.com/v2/repositories/library/?page=1&page_size=100" | \
jq '.results'
지금 상점에서 또는 dockerhub에서 하나의 이미지를 조회 할 수 https://store.docker.com에서 내부 API가있다. dockerhub에서 가장 인기있는 것들로 검색 할 수 있습니다 :
https://store.docker.com/api/content/v1/products/search?page_size=100&q=%2B&source=community&type=image%2Cbundle
요청 결과는 popularity
숫자 필드가 있습니다. 인기도가 내림차순으로 필터링 된 이미지를 얻으려면 :
curl -s "https://store.docker.com/api/content/v1/products/search?page_size=100&q=%2B&source=community&type=image%2Cbundle" | \
jq '.summaries | sort_by(-.popularity)'
API 문서를 읽었습니까? https://docs.docker.com/v1.4/reference/api/docker-io_api/ – jonrsharpe