godt - Go Docker Tag
godt -- Go library for getting docker image tags
Why godt?
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
Installation
go get -u github.com/cuonglm/godt
Usage
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
Environment variables
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
Note
Currently, authentication is not supported.
Author
Cuong Manh Le cuong.manhle.vn@gmail.com
License
See LICENSE