Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save morancj/01f334f15a85bb7b78b15980f8105eb4 to your computer and use it in GitHub Desktop.

Select an option

Save morancj/01f334f15a85bb7b78b15980f8105eb4 to your computer and use it in GitHub Desktop.

Revisions

  1. @kizbitz kizbitz revised this gist Aug 4, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dockerhub-v2-api-organization.sh
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ for i in ${REPO_LIST}
    do
    echo "${i}:"
    # tags
    IMAGE_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/${ORG}/${i}/tags/?page_size=10000 | jq -r '.results|.[]|.name')
    IMAGE_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/${ORG}/${i}/tags/?page_size=100 | jq -r '.results|.[]|.name')
    for j in ${IMAGE_TAGS}
    do
    echo " - ${j}"
  2. @kizbitz kizbitz revised this gist Aug 4, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dockerhub-v2-api-organization.sh
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'$

    # get list of repositories
    echo "Retrieving repository list ..."
    REPO_LIST=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/${ORG}/?page_size=10000 | jq -r '.results|.[]|.name')
    REPO_LIST=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/${ORG}/?page_size=100 | jq -r '.results|.[]|.name')

    # output images & tags
    echo
  3. @kizbitz kizbitz revised this gist Jun 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dockerhub-v2-api-organization.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/bin/bash

    # Example for the Docker Hub V2 API
    # Returns all imagas and tags associated with a Docker Hub organization account.
    # Returns all images and tags associated with a Docker Hub organization account.
    # Requires 'jq': https://stedolan.github.io/jq/

    # set username, password, and organization
  4. @kizbitz kizbitz revised this gist Jun 13, 2016. No changes.
  5. @kizbitz kizbitz revised this gist Jun 13, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions dockerhub-v2-api-organization.sh
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@

    # Example for the Docker Hub V2 API
    # Returns all imagas and tags associated with a Docker Hub organization account.
    # Requires 'jq': https://stedolan.github.io/jq/

    # set username, password, and organization
    UNAME=""
  6. @kizbitz kizbitz revised this gist Jun 13, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions dockerhub-v2-api-organization.sh
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,7 @@ UPASS=""
    ORG=""

    # -------

    set -e
    echo

  7. @kizbitz kizbitz renamed this gist Jun 13, 2016. 1 changed file with 6 additions and 2 deletions.
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,17 @@
    #!/bin/bash

    set -e
    echo
    # Example for the Docker Hub V2 API
    # Returns all imagas and tags associated with a Docker Hub organization account.

    # set username, password, and organization
    UNAME=""
    UPASS=""
    ORG=""

    # -------
    set -e
    echo

    # get token
    echo "Retrieving 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)
  8. @kizbitz kizbitz revised this gist May 5, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions get-dockerhub-info-org.sh
    Original file line number Diff line number Diff line change
    @@ -8,11 +8,11 @@ UNAME=""
    UPASS=""
    ORG=""

    # get token to be able to talk to Docker Hub
    # get token
    echo "Retrieving 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 for the organization
    # get list of repositories
    echo "Retrieving repository list ..."
    REPO_LIST=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/${ORG}/?page_size=10000 | jq -r '.results|.[]|.name')

  9. @kizbitz kizbitz created this gist May 5, 2016.
    33 changes: 33 additions & 0 deletions get-dockerhub-info-org.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    #!/bin/bash

    set -e
    echo

    # set username, password, and organization
    UNAME=""
    UPASS=""
    ORG=""

    # get token to be able to talk to Docker Hub
    echo "Retrieving 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 for the organization
    echo "Retrieving repository list ..."
    REPO_LIST=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/${ORG}/?page_size=10000 | jq -r '.results|.[]|.name')

    # output images & tags
    echo
    echo "Images and tags for organization: ${ORG}"
    echo
    for i in ${REPO_LIST}
    do
    echo "${i}:"
    # tags
    IMAGE_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/${ORG}/${i}/tags/?page_size=10000 | jq -r '.results|.[]|.name')
    for j in ${IMAGE_TAGS}
    do
    echo " - ${j}"
    done
    echo
    done