programing

원격 레지스트리에서 도커 이미지에 대한 모든 태그를 나열하려면 어떻게 해야 합니까?

cafebook 2023. 8. 26. 12:16
반응형

원격 레지스트리에서 도커 이미지에 대한 모든 태그를 나열하려면 어떻게 해야 합니까?

CLI(기본 설정) 또는 컬을 사용하여 원격 도커 레지스트리에 도커 이미지의 모든 태그를 나열하려면 어떻게 해야 합니까?

원격 레지스트리에서 모든 버전을 가져오지 않는 것이 좋습니다.저는 단지 태그를 나열하고 싶습니다.

업데이트: Docker가 Docker Hub v1 API를 더 이상 사용하지 않습니다.v2 API를 사용하여 태그를 가져오려면 예를 들어,

wget -q -O - "https://hub.docker.com/v2/namespaces/library/repositories/debian/tags?page_size=100" | grep -o '"name": *"[^"]*' | grep -o '[^"]*$'

참고: 결과는 최신 100개 태그로 제한됩니다.다음 100개의 태그를 가져오려면 URL을 다음으로 설정합니다.https://.../tags?page_size=100&page=2

도커 공식 이미지가 아닌 이미지의 경우 대체library사용자/조직의 이름을 입력합니다.

URLhttps://hub.docker.com/v2/repositories/{namespace}/{repository}/tags또한 현재는 작동하지만 API 사양에서 합법적인지는 불분명합니다.

이 가지고 있다면)jq을 설된치 kludgy grep 령음로로 바꿀 수 .jq -r '.results[].name'.)


원본 답변(v1 API, 더 이상 지원되지 않음):

는 여기서 답을 얻었습니다.정말 감사합니다! :)

단 한 줄 스크립트:(데비안의 모든 태그 찾기)

wget -q https://registry.hub.docker.com/v1/repositories/debian/tags -O -  | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n'  | awk -F: '{print $3}'

업데이트 @degelf의 조언에 감사드립니다.여기 셸 스크립트가 있습니다.

#!/bin/bash

if [ $# -lt 1 ]
then
cat << HELP

dockertags  --  list all tags for a Docker image on a remote registry.

EXAMPLE: 
    - list all tags for ubuntu:
       dockertags ubuntu

    - list all php tags containing apache:
       dockertags php apache

HELP
fi

image="$1"
tags=`wget -q https://registry.hub.docker.com/v1/repositories/${image}/tags -O -  | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n'  | awk -F: '{print $3}'`

if [ -n "$2" ]
then
    tags=` echo "${tags}" | grep "$2" `
fi

echo "${tags}"

이름인 새파이만들수있다니습름을일을 하면 됩니다.dockertags /usr/local/).bashrc/.zshrc), 다음 합니다.chmod +x dockertags).

용도:

dockertags ubuntu합니다.---> 우분투의 태그입니다.

dockertags php apache '가 포함된 합니다. > 'php' php php php php 를다니합열나태그가든모된함포▁--다▁all▁php를▁php'니->▁cont---apache▁tags▁'aining합▁list>열▁'나가

도커레트 V2 으로한, GET충분:

GET /v2/<name>/tags/list

자세한 내용은 문서를 참조하십시오.

p.s. 이미지 레지스트리에 인증이 필요하고 "unauthorized" 텍스트가 포함된 오류 메시지가 표시되는 경우 이 페이지 아래에 해결 방법이 있습니다.

도커 레지스트리 v2 API를 사용하려면 태그를 페이지별로 나열합니다.이미지의 모든 태그를 나열하려면 URL에 큰 page_size 매개 변수를 추가할 수 있습니다.

curl -L -s 'https://registry.hub.docker.com/v2/repositories/library/centos/tags?page_size=1024'|jq '."results"[]["name"]'

도커 레지스트리 API V2에는 적절한 클레임이 포함된 OAuth 베어러 토큰이 필요합니다.제 생각에 공식 문서는 주제에 대해 다소 모호합니다.다른 사람들이 저와 같은 고통을 겪지 않도록 아래와 같이 제안합니다.docker_tags기능.

docker_tagsGitHub Gist: "bash를 사용하여 도커 이미지 태그 나열"에서 찾을 수 있습니다.편집자 참고 사항: 버전이 서로 다릅니다.

docker_tags 함수는 jq에 종속되어 있습니다.JSON을 가지고 놀고 있다면 이미 가지고 있을 것입니다.

#!/usr/bin/env bash
set -eu -o pipefail
docker_tags() {
    item="$1"
    case "$item" in
        */*) :;; # namespace/repository syntax, leave as is
        *) item="library/$item";; # bare repository name (docker official image); must convert to namespace/repository syntax
    esac
    authUrl="https://auth.docker.io/token?service=registry.docker.io&scope=repository:$item:pull"
    token="$(curl -fsSL "$authUrl" | jq --raw-output '.token')"
    tagsUrl="https://registry-1.docker.io/v2/$item/tags/list"
    curl -fsSL -H "Accept: application/json" -H "Authorization: Bearer $token" "$tagsUrl" | jq --raw-output '.tags[]'
}
docker_tags "$@"

예:

$ docker_tags "alpine"
2.6
2.7
20190228
20190408
...
3
3.1
3.10
3.10.0
3.10.1
...
3.9.5
3.9.6
edge
latest

인하건대정,대,docker_tags몇 가지 가정을 합니다.특히 OAuth 요청 매개 변수는 대부분 하드 코딩됩니다.보다 야심찬 구현은 레지스트리에 인증되지 않은 요청을 하고 인증되지 않은 응답에서 OAuth 매개 변수를 도출합니다.

cli를 통해 json 구문 분석과 함께 및 for json의 모든 태그를 나열할 수 있습니다.

skopeo --override-os linux inspect docker://httpd | jq '.RepoTags'
[
  "2-alpine",
  "2.2-alpine",
  "2.2.29",
  "2.2.31-alpine",
  "2.2.31",
  "2.2.32-alpine",
  "2.2.32",
  "2.2.34-alpine",
  "2.2.34",
  "2.2",
  "2.4-alpine",
  "2.4.10",
  "2.4.12",
  "2.4.16",
  "2.4.17",
  "2.4.18",
  "2.4.20",
  "2.4.23-alpine",
  "2.4.23",
  "2.4.25-alpine",
  "2.4.25",
  "2.4.27-alpine",
  "2.4.27",
  "2.4.28-alpine",
  "2.4.28",
  "2.4.29-alpine",
  "2.4.29",
  "2.4.32-alpine",
  "2.4.32",
  "2.4.33-alpine",
  "2.4.33",
  "2.4.34-alpine",
  "2.4.34",
  "2.4.35-alpine",
  "2.4.35",
  "2.4.37-alpine",
  "2.4.37",
  "2.4.38-alpine",
  "2.4.38",
  "2.4.39-alpine",
  "2.4.39",
  "2.4.41-alpine",
  "2.4.41",
  "2.4.43-alpine",
  "2.4.43",
  "2.4",
  "2",
  "alpine",
  "latest"
]

외부 레지스트리의 경우:

skopeo --override-os linux inspect --creds username:password docker://<registry-url>/<repo>/<image> | jq '.RepoTags'

참고:--override-os linuxLinux 호스트에서 실행되지 않는 경우에만 필요합니다.예를 들어 MacOS를 사용하는 경우 더 나은 결과를 얻을 수 있습니다.

구문 도구인 , JSON은jq 가능합니다.

wget -q https://registry.hub.docker.com/v1/repositories/debian/tags -O - | \
    jq -r '.[].name'

저는 컬을 사용하여 그것을 작동시킬 수 있었습니다.

curl -u <username>:<password> https://myrepo.example/v1/repositories/<username>/<image_name>/tags

:image_name사용자 세부 정보 등을 포함해서는 안 됩니다.를 들어 예를들이지름정이푸경미우시는라는 이름의 를 누르는 .myrepo.example/username/x그리고나서image_name야 .x.

Yan Foto의 답변(v2 api)을 바탕으로 주어진 이미지에 대한 태그를 나열하는 간단한 Python 스크립트를 만들었습니다.

용도:

./docker-registry-list.py alpine

출력:

{
  "name": "library/alpine",
  "tags": [
    "2.6",
    "2.7",
    "3.1",
    "3.2",
    "3.3",
    "3.4",
    "3.5",
    "3.6",
    "3.7",
    "edge",
    "latest"
  ]
}

2023년 기준으로 이를 위한 다양한 툴이 있습니다.

docker run --rm ghcr.io/regclient/regctl:v0.4.5 tag ls ghcr.io/regclient/regctl      

docker run --rm quay.io/skopeo/stable:v1.9.2 list-tags docker://quay.io/skopeo/stable \
  | jq -r '.Tags[]'

docker run --rm gcr.io/go-containerregistry/crane ls gcr.io/go-containerregistry/crane  

docker run --rm r.j3ss.co/reg:v0.16.1 tags r.j3ss.co/reg

BTW - 훨씬 더 많은 도구가 있습니다.포괄적으로 .
이시미우즈/시크롬-시크롬-시크롬-시크롬-분쇄

CLI 유틸리티 참조: https://www.npmjs.com/package/docker-browse

태그 및 이미지를 열거할 수 있습니다.

docker-browse tags <image>를 들어 이지에대태모나그열됩다니가든한미.docker-browse tags library/alpine

docker-browse images레지스트리에 있는 모든 이미지를 나열합니다. 현사 수없음에 할 수 .index.docker.io.

도커 레지스트리 HTTP API V2를 지원하는 한 개인 레지스트리를 포함한 모든 레지스트리에 연결할 수 있습니다.

터미널에서 실행하면 다음을 수행할 수 있습니다.

curl -L -s 'https://registry.hub.docker.com/v2/repositories/library/mysql/tags/' | jq . | grep name

또한, 만약 당신이 jq가 없다면 당신은 그것을 설치해야 합니다.

sudo apt-get install jq

다음은 Windows용으로 작성한 Powershell 스크립트입니다.v1 및 v2 저장소 처리:

Get-Docker ImageVersions.ps1:

param (
  [Parameter (Mandatory=$true)]$ImageName,
  [Parameter (Mandatory=$false)]$RegistryURL
)

if (!$RegistryURL) 
{
  $RegistryURL = "https://registry.hub.docker.com/v1/repositories"
}

$list = ""
if ($RegistryURL -like "*v2*") 
{
  $list = "/list"
}

$URL = "$RegistryURL/$ImageName/tags$list"

write-debug $URL
$resp = Invoke-WebRequest -UseBasicParsing $URL | ConvertFrom-Json

if ($RegistryURL -like "*v2*") 
{
  $tags = $resp | select tags
  $tags.tags
} else {
  $tags = $resp | select name
  $tags.name
}

Hub에서 : 이 Docker Hub를 합니다.JSON프로세서에서 태그 이름을 선택합니다.JSON에서 반환됨( Hub로 제거됨)tr. 라이브러리를 Docker Hub 사용자 이름, debian을 이미지 이름으로 바꿉니다.

curl -s 'https://registry.hub.docker.com/v2/repositories/library/debian/tags/' | jq -r '."results"[]["name"]'

브라우저에서 사용 가능한 모든 태그를 보려면 다음과 같이 하십시오.

https://registry.hub.docker.com/v1/repositories/<username>/<image_name>/tags

예: https://hub.docker.com/r/localstack/localstack/tags

또는 다음 끝점을 사용하여 json 응답을 받을 수 있습니다.

https://registry.hub.docker.com/v1/repositories/localstack/localstack/tags

나의 기여:

  • 셸 스크립트
  • 가능한 한 짧고 간단함
  • 요사구가 합니다.curl그리고.jq
  • Docker v2 REST API 사용
  • REST API 페이지를 사용하여 모든 태그를 반환합니다.

예:

$ docker-tags prantlf/chromedriver-headless
latest
102
93
86

스크립트 내용:

#!/bin/sh

image=$1
if [ "$image" == "" ]; then
  echo "Usage:
  docker-tags <image>

Example:
  docker-tags library/ubuntu"
  exit 0
fi

page_size=100
page_index=0
while true; do 
  page_index=$((page_index+1))
  results=`curl -L -s "https://registry.hub.docker.com/v2/repositories/$image/tags?page=$page_index&page_size=$page_size" | jq -r 'select(.results != null) | .results[]["name"]'`
  if [ $? != 0 ] || [ "$results" == "" ]; then
    break
  fi
  echo "$results"
done
curl -u <username>:<password> https://$your_registry/v2/$image_name/tags/list -s -o - | \
    tr -d '{' | tr -d '}' | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | \
    awk -F: '{print $3}' | sed -e 's/,/\n/g'

환경에 'jq'가 없으면 사용할 수 있습니다. = )

사용할 수 있는 항목:

skopeo inspect docker://<REMOTE_REGISTRY> --authfile <PULL_SECRET> | jq .RepoTags

다음은 모든 태그를 2자리 또는 3자리로 나열하는 스크립트입니다.당신은 github https://github.com/youssefalaoui/dockerhub-tools/blob/main/dockerhub-list-tags.sh 에서 직접 코드를 얻을 수 있습니다.

dockerhub_list_tags()
{
    #local LOCAL_IMAGE LOCAL_GET_TWO_DIGITS_VERSIONS
     
    LOCAL_IMAGE=${1:-null}
    LOCAL_GET_TWO_DIGITS_VERSIONS=${2:-true}


    if [[ $LOCAL_IMAGE == "" || $LOCAL_IMAGE == null ]]
    then
        printf "Image name is required: %s" ${FUNCNAME[0]}; 
        exit 1;
    fi

    #[[ $LOCAL_IMAGE == "" || $LOCAL_IMAGE == null ]] && printf "Image name is required: %s" ${FUNCNAME[0]}; exit 1;

    echo "Listing tags from docker hub for your image '$LOCAL_IMAGE'"
    
    # Check if 2 digits format is requested, otherwise, show it in normal format
    
    if [[ "$LOCAL_GET_TWO_DIGITS_VERSIONS" == true ]]; then
        DOCKERHUB_LIST_TAGS=($(curl -L -s "https://registry.hub.docker.com/v2/repositories/$LOCAL_IMAGE/tags?page_size=1024"|jq '."results"[]["name"]' | sed 's/"//g' | sed 's/\.[^.]*$//'))
    else
        DOCKERHUB_LIST_TAGS=($(curl -L -s "https://registry.hub.docker.com/v2/repositories/$LOCAL_IMAGE/tags?page_size=1024"|jq '."results"[]["name"]' | sed 's/"//g'))
    fi

    for TAG in ${DOCKERHUB_LIST_TAGS[@]}
    do
    echo $TAG
    done
}


# Test example
dockerhub_list_tags "library/nginx" false

이 스크랩도 사용할 수 있습니다.

# vim /usr/sbin/docker-tags 

다음 항목을 그대로 추가합니다.

#!/bin/bash
im="$1"
[[ -z "$im" ]] && { echo -e '\e[31m[-]\e[39m Where is the image name ??' ; exit ; }
[[ -z "$(echo "$im"| grep -o '/')" ]] && { link="https://hub.docker.com/r/library/$im/tags/" ; } || { link="https://hub.docker.com/r/$im/tags/" ; }
resp="$(curl -sL "$link")"
err="$(echo "$resp" | grep -o 'Page Not Found')"
if [[ ! -z "$err" ]] ; then
    echo -e "\e[31m[-]\e[39m No Image Found with name => [ \e[32m$im\e[39m ]"
    exit
else
    tags="$(echo "$resp"|sed  -e 's|}|\n|g' -e 's|{|\n|g'|grep '"result"'|sed -e 's|,|\n|g'|cut -d '[' -f2|cut -d ']' -f1|sed  '/"tags":/d'|sed -e 's|"||g')"
    echo -e "\e[32m$tags\e[39m"
fi

실행 파일로 만들기:

# chmod 755 /usr/sbin/docker-tags

마지막으로 시도:

$ docker-tags testexampleidontexist
   [-] No Image Found with name => [ testexampleidontexist ]

$ docker search ubuntu

$ docker-tags teamrock/ubuntu
   latest

[ 명령어를 실행하기 전에 $ & #를 알고 있기를 바랍니다]

만약 의 태그를 , 레드햇을 사용하세요.https://registry.redhat.io/v2는 다음과 같습니다.

# example nodejs-12 image
IMAGE_STREAM=nodejs-12
REDHAT_REGISTRY_API="https://registry.redhat.io/v2/rhel8/$IMAGE_STREAM"
# Get an oAuth token based on a service account username and password https://access.redhat.com/articles/3560571
TOKEN=$(curl --silent -u "$REGISTRY_USER":"$REGISTRY_PASSWORD" "https://sso.redhat.com/auth/realms/rhcc/protocol/redhat-docker-v2/auth?service=docker-registry&client_id=curl&scope=repository:rhel:pull" |  jq --raw-output '.token')
# Grab the tags
wget -q --header="Accept: application/json" --header="Authorization: Bearer $TOKEN" -O - "$REDHAT_REGISTRY_API/tags/list" | jq -r '."tags"[]' 

로컬 오픈시프트 레지스트리에 있는 것과 업스트림 registry.redhat.com 에 있는 것을 비교하고 싶다면, 여기 완전한 스크립트가 있습니다.

powershell 5.1에는 다음과 같은 간단한 list_docker_image_tags.ps1 스크립트가 있습니다.

[CmdletBinding()]
param (
    [Parameter(Mandatory = $true)]
    [string]
    $image
)

$url = "https://registry.hub.docker.com/v1/repositories/{0}/tags" -f $image 
Invoke-WebRequest $url  | ConvertFrom-Json | Write-Output

그러면 다음과 같은 4.7개의 태그를 grep할 수 있습니다.

./list_docker_image_tags.ps1 microsoft/dotnet-framework | ?{ $_.name -match "4.7" }

도커 레지스트리 API에는 모든 태그를 나열하는 끝점이 있습니다.

Tutum에도 tutum-cli를 통해 액세스하는 방법뿐만 아니라 비슷한 엔드포인트가 있는 것 같습니다.

tutum-cli를 사용하여 다음을 시도합니다.

tutum tag list <uuid>

다음은 레지스트리의 v2에 해당하는 답변입니다.

가지고 계신다면,jq그리고.curl컴퓨터에 설치:

curl https://registry.hub.docker.com/v2/repositories/$REPOSITORY/tags?page_size=10000 | jq '.results[] | { name: .name, architectures: ([ (.images[] | if .variant? then .os + "/" + .architecture + .variant? else .os + "/" + .architecture end) ] | join(", ")) }'

를 들어 이 는 " " ", ", " " 입니다.curlimages/curl리포지토리 산출량:

{
  "name": "latest",
  "architectures": "linux/ppc64le, linux/s390x, linux/arm64, linux/386, linux/armv7, linux/amd64"
}
{
  "name": "7.78.0",
  "architectures": "linux/armv7, linux/arm64, linux/386, linux/s390x, linux/ppc64le, linux/amd64"
}
{
  "name": "7.77.0",
  "architectures": "linux/ppc64le, linux/arm64, linux/s390x, linux/armv7, linux/386, linux/amd64"
}
{
  "name": "7.76.1",
  "architectures": "linux/386, linux/arm64, linux/armv7, linux/ppc64le, linux/s390x, linux/amd64"
}
{
  "name": "7.76.0",
  "architectures": "linux/armv7, linux/386, linux/s390x, linux/amd64, linux/ppc64le, linux/arm64"
}
{
  "name": "7.75.0",
  "architectures": "linux/armv7, linux/ppc64le, linux/386, linux/amd64, linux/arm64, linux/s390x"
}
{
  "name": "7.74.0",
  "architectures": "linux/armv7, linux/386, linux/amd64, linux/ppc64le, linux/s390x, linux/arm64"
}
{
  "name": "7.73.0",
  "architectures": "linux/arm64, linux/armv7, linux/s390x, linux/ppc64le, linux/amd64, linux/386"
}
{
  "name": "7.72.0",
  "architectures": "linux/s390x, linux/amd64, linux/arm64, linux/386, linux/ppc64le, linux/armv7"
}
{
  "name": "7.71.1",
  "architectures": "linux/s390x, linux/arm64, linux/ppc64le, linux/amd64, linux/386, linux/armv7"
}
{
  "name": "7.71.0",
  "architectures": "linux/arm64, linux/ppc64le, linux/386, linux/s390x, linux/amd64, linux/armv7"
}
{
  "name": "7.70.0",
  "architectures": "linux/386, linux/arm64, linux/s390x, linux/amd64, linux/ppc64le, linux/armv7"
}
{
  "name": "7.69.1",
  "architectures": "linux/amd64"
}
{
  "name": "7.69.0",
  "architectures": "linux/amd64"
}
{
  "name": "7.68.0",
  "architectures": "linux/amd64"
}
{
  "name": "7.67.0",
  "architectures": "linux/amd64"
}
{
  "name": "7.66.0",
  "architectures": "linux/amd64"
}
{
  "name": "7.65.3",
  "architectures": "linux/amd64"
}

편집: 질문에 대한 답변:

CLI(기본 설정) 또는 컬을 사용하여 원격 도커 레지스트리에 도커 이미지의 모든 태그를 나열하려면 어떻게 해야 합니까?

원격 레지스트리에서 모든 버전을 가져오지 않는 것이 좋습니다.저는 단지 태그를 나열하고 싶습니다.

이미지에 대한 모든 태그를 가져오려면 "curl"을 사용하여 원하는 특정 이미지를 가져오고 출력을 "jq"로 연결하여 정보를 추출할 수 있습니다.

curl -L -s 'https://registry.hub.docker.com/v2/repositories/library/python/tags?page_size=1024'|jq  '.results[]["name"]'    

출력(전체 목록이 아닌 잘라짐):

"3.9-windowsservercore"  
"alpine3.14"  
"alpine3.13"  
"alpine"  
"3.9.8-alpine3.14"  
"3.9.8-alpine3.13"
"3.9.8-alpine"

레지스트리에서 추가 정보가 필요한 경우 다음과 같은 추가 필드 정보에 액세스할 수 있습니다.

이 명령을 사용하면 태그와 이미지 크기를 모두 표시할 수 있어 유용할 수 있습니다.

curl -L -s 'https://registry.hub.docker.com/v2/repositories/library/python/tags?page_size=1024'|jq  '.results[] as $results | ($results["name"] + " - " + ($results["full_size"] | tostring))'

출력(전체 목록이 아닌 잘라짐):

 "3.9-windowsservercore - 2241040278"  
 "alpine3.14 - 17565702"  
 "alpine3.13 - 17556181"  
 "alpine - 17565702"  
 "3.9.8-alpine3.14 -17362557"  
 "3.9.8-alpine3.13 - 17353629"  
 "3.9.8-alpine - 17362557"  

지금까지 주어진 답변 중 중복되는 답변이 많습니다.대부분의 경우 Dockkkkkkkkkkkkkkkkkkkkkkkkkkkkker Hub API(최소 v2)가 한 번에 100개 이상의 결과를 반환하지 않는다는 점을 고려하지 않습니다.에 대한 태그를 요청할 때 이를 알게 되었습니다.

다음 스크립트는 이 문제를 해결합니다.공용 리포지토리에서만 작동합니다.

#!/bin/sh

# list the tags on Docker Hub for the given image(s)
# thank you, https://stackoverflow.com/questions/28320134/how-can-i-list-all-tags-for-a-docker-image-on-a-remote-registry

TagsFor()
{
  curl -L -s 'https://registry.hub.docker.com/v2/repositories/library/'$1'/tags?page='$2'&page_size'=$3
}

for i in "$@"
do
  TagsFor "$i" 1 10 |
  jq -r .count |
  while read nr_of_tags
  do
    nr_of_pages=`expr $nr_of_tags / 100`
    seq 1 $nr_of_pages |
    while read p
    do
      TagsFor "$i" "$p" 100 |
      jq -r '.results[] | .name'
    done
  done
done

방금 스크립트를 실행했는데 7200이 검색되었습니다.php태그. 내가 아는 한, 그것은 또 다른 API 제한에 부딪힐 수 있지만, 7200 >> 100.

사용자가 어떻게든 잘못된 태그를 입력하면 레지스터에 있는 레포(도커 레포)에 있는 모든 태그의 목록을 제공해야 하는 작업을 구현해야 할 때 이 작업을 수행했습니다.그래서 일괄 스크립트에 코드가 있습니다.

<html>
<pre style="background-color:#bcbbbb;">
@echo off

docker login --username=xxxx --password=xxxx
docker pull %1:%2

IF NOT %ERRORLEVEL%==0 (
echo "Specified Version is Not Found "
echo "Available Version for this image is :"
for /f %%i in (' curl -s -H "Content-Type:application/json" -X POST -d "{\"username\":\"user\",\"password\":\"password\"}" https://hub.docker.com/v2/users/login ^|jq -r .token ') do set TOKEN=%%i
curl -sH "Authorization: JWT %TOKEN%" "https://hub.docker.com/v2/repositories/%1/tags/" | jq .results[].name
)
</pre>
</html>

따라서 아웃 배치 파일에 다음과 같은 인수를 지정할 수 있습니다.

도커 파일 Java 버전 7

@AlexForbes의 답변을 바탕으로 api v2 docker-registry-list.py 을 다음을 지원하도록 개선했습니다.
: ) 및 "curlimages/slash"(": curlimages/slash") »
reposit과 비밀번호에 는 다음과 같습니다.

https://github.com/axil/docker-registry-list

용도:

./docker-registry-list.py -u dockerid -p password dockerid/myrepo

출력:

{
  "name": "dockerid/myrepo",
  "tags": [
    "1.0"
  ]
}

내가 다운로드하는 데 사용할 수 있는 자바의 SDK를 찾고 있었습니다.Docker V2 API하지만 찾을 수 없었습니다.유용하다고 생각되는 사용자는 https://github.com/fern-api/docker-registry-api 를 참조하십시오.

다른 언어로도 생성이 가능해야 합니다. 레포에서 자유롭게 이슈를 오픈하세요!

사중인경우를 .podman사용할 수 있습니다.podman search --list-tags <image name>. https://docs.podman.io/en/latest/markdown/podman-search.1.html

이 .docker명령을 내렸지만, 나는 그것을 찾을 수 없었습니다.list-tags선택.https://docs.docker.com/engine/reference/commandline/search/

언급URL : https://stackoverflow.com/questions/28320134/how-can-i-list-all-tags-for-a-docker-image-on-a-remote-registry

반응형