Skip to content

Instantly share code, notes, and snippets.

@hiddeco
Created April 7, 2022 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiddeco/81a83f9ce24f3772c8d8b293c2a9ff17 to your computer and use it in GitHub Desktop.
Save hiddeco/81a83f9ce24f3772c8d8b293c2a9ff17 to your computer and use it in GitHub Desktop.
Tiny shell script to get exact stats from DockerHub
#!/usr/bin/env sh
if [ "$#" -eq 0 ]
then
echo -e "usage:\t$0 <image>" >&2
echo -e "\t$0 mysql/mysql-server" >&2
exit 1
fi
if ! command -v jq &> /dev/n
then
echo "jq is not available on your system" >&2
exit 1
fi
image=$1
url="https://hub.docker.com/v2/repositories/${image}/"
echo "Getting data for ${image}" >&2
curl -s $url | jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment