Skip to content

Instantly share code, notes, and snippets.

@ravexina
Created March 23, 2019 10:17
Show Gist options
  • Select an option

  • Save ravexina/c85885ca82c3b2d123c3984113e322e2 to your computer and use it in GitHub Desktop.

Select an option

Save ravexina/c85885ca82c3b2d123c3984113e322e2 to your computer and use it in GitHub Desktop.
Search for Docker image tags
#!/bin/bash
IMAGE="$1"
QUERY="$2"
curl -s "https://hub.docker.com/v2/repositories/library/${IMAGE}/tags/?page_size=500" | jq -r ".results[] .name" | grep "$QUERY"
###
#
# $ ./search.sh python 3.4
#
# RESULTS:
#
# 3.4
# 3.4.10
# 3.4-alpine3.8
# 3.4.10-alpine3.8
# 3.4-alpine
# 3.4.10-alpine
# 3.4-alpine3.9
# 3.4.10-alpine3.9
# 3.4-wheezy
# 3.4.10-wheezy
# 3.4-slim-jessie
# 3.4.10-slim-jessie
# 3.4-jessie
# 3.4.10-jessie
# 3.4-slim
# 3.4.10-slim
# 3.4-slim-stretch
# 3.4.10-slim-stretch
# 3.4-stretch
# 3.4.10-stretch
#
###
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment