Last active
April 12, 2017 11:53
-
-
Save jriguera/4bd5140a6aecb902a09a3f0fec2b4455 to your computer and use it in GitHub Desktop.
Revisions
-
jriguera revised this gist
Apr 4, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,4 +18,4 @@ set -e TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${UNAME}'", "password": "'${UPASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) # get list of repositories ordered by last_updated curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/${ORG}/?page_size=200 | jq '.results|sort_by(.last_updated)|.[]|.namespace + "/" + .name + " updated=" + .last_updated' -
jriguera revised this gist
Apr 4, 2017 . No changes.There are no files selected for viewing
-
jriguera created this gist
Apr 4, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/bash # Based on kizbitz/dockerhub-v2-api-organization.sh at https://gist.github.com/kizbitz/175be06d0fbbb39bc9bfa6c0cb0d4721 # Example for the Docker Hub V2 API # Returns all images and tags associated with a Docker Hub organization account. # Requires 'jq': https://stedolan.github.io/jq/ # set username, password, and organization UNAME="" UPASS="" ORG="" # ------- set -e # get token TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${UNAME}'", "password": "'${UPASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) # get list of repositories ordered by last_updated curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/${ORG}/?page_size=200 | jq '.results|sort_by(.last_updated)|.[]|.namespace + "/" + .name + " updated=" + .l$