dockertags script pulls all available tags from docker-hub

This commit is contained in:
root
2018-02-28 11:04:45 +01:00
committed by Tobias Kessels
parent ad532cf1e9
commit 287abc1c09

11
dockertags Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
image="$1"
tags=`wget -q https://registry.hub.docker.com/v1/repositories/${image}/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'`
if [ -n "$2" ]
then
tags=` echo "${tags}" | grep "$2" `
fi
echo "${tags}"