Skip to content

Instantly share code, notes, and snippets.

@ashirazi2
ashirazi2 / docker-tags
Last active August 25, 2023 13:58
List all tags for a Docker image
# Add this function somewhere useful like ~/.bash_login or ~/.zlogin
docker-tags() {
if [ -z "$@" ]; then
echo "usage: docker-tags org/repo" >&2
else
TOKEN="$(security find-generic-password -a "$USER" -s dockerhub-token -w)"
if [ -z "$TOKEN" ]; then
echo "ensure MacOS keychain has: name: dockerhub-token acct: $USER" >&2
else
if ! grep -q / <<< "$@"; then