Skip to content

API for storing and managing metadata related to images in Docker registry

License

Notifications You must be signed in to change notification settings

jsw0011/docker-registry-metadata-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Useful links

How to generate model/server/client

Official docs:

It uses swagger generation tool:

docker run --rm -e GOPATH=/home/$USER/go:/go -v ${HOME}:${HOME} -w $(pwd) -u $(id -u):$(id -g) quay.io/goswagger/swagger:v0.25.0 generate model --template=stratoscale
docker run --rm -e GOPATH=/home/$USER/go:/go -v ${HOME}:${HOME} -w $(pwd) -u $(id -u):$(id -g) quay.io/goswagger/swagger:v0.25.0 generate server --template=stratoscale

If you use Fish shell then run it in following format:

docker run --rm -e GOPATH=/Users/User/go:/go -v {$HOME}:{$HOME} -w (pwd) -u (id -u):(id -g) quay.io/goswagger/swagger:v0.25.0 generate model --template=stratoscale
docker run --rm -e GOPATH=/Users/User/go:/go -v {$HOME}:{$HOME} -w (pwd) -u (id -u):(id -g) quay.io/goswagger/swagger:v0.25.0 generate server --template=stratoscale

Quick command reference

  • add to shell: alias goswagger='docker run --rm -it --user $(id -u):$(id -g) -e GOPATH=$GOPATH:/go -v $HOME:$HOME -w $(pwd) quay.io/goswagger/swagger:v0.29.0'

  • shell usage: $ goswagger generate operation --template=stratoscale && goswagger generate model --template=stratoscale && goswagger generate server --template=stratoscale

Example usage:

  • Add metadata key:
    • Before calling endpoint for registering key and value, the image with tag should exist in DB
curl --location --request POST 'http://localhost:8080/metadata/image/tag/keys' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
  "ImageName": "image-name",
  "TagName": "v0.2.2021-12-17.1654614216",
  "Key": "input::myCustomName",
  "Value": "/usr/bin"
}'
  • Register image to metadata API:
curl --location --request POST 'http://localhost:8080/metadata' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
  "ImageName": "image-name",
  "TagName": "v0.2.2021-12-17.1654614216",
}'

About

API for storing and managing metadata related to images in Docker registry

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages