godt -- Go library for getting docker image tags
At this time, there's no way to get image tags from docker client. We can use any HTTP client to get tags from docker hub:
curl https://registry.hub.docker.com//v1/repositories/fedora/tags | python -mjson.tool
It's too complicated from user perspective, so godt come in for simplification
go get -u github.com/cuonglm/godt
import "github.com/cuonglm/godt"
Example can be seen in bin/docker-tags-v1
$ go build docker-tags-v1.go
$ docker-tags-v1 -image alpine
latest
2.6
2.7
3.1
3.2
3.3
edge
You can use GODT_HUB_API_VERSION
and GODT_HUB_URL
environment variable to change the docker hub version and url. Example with docker-tags-v1
:
$ GODT_HUB_API_VERSION=2 ./docker-tags-v1
The requested URL (/v2//tags/list) was not found on this server.
By default, GODT_HUB_API_VERSION
is 1
and GODT_HUB_URL
is https://registry.hub.docker.com
Currently, authentication is not supported.
Cuong Manh Le cuong.manhle.vn@gmail.com
See LICENSE