estesp / mquery

Multi-platform (manifest list/OCI index) registry image query utility
Apache License 2.0
83 stars 5 forks source link
docker lambda-functions manifest-lists multi-platform oci-image

mquery

A simple utility and serverless-based backend for querying Docker v2 & OCI v1 container images and reporting on "manifest list"/OCI "index" multi-platform image support.

About

This project uses AWS Lambda as a backend, in concert with the manifest-tool inspect API capability to easily report on the status of whether an image is a manifest list/OCI index entry in a registry, and if so, what platforms are supported by the image.

Usage

You can use the public endpoint with curl and JSON formatting tools to query images directly. See the next section for a tool which performs this for you and provides a simple text output. This tool is published as a multi-platform image on DockerHub as mplatform/mquery; for example you can look up the mplatform/mquery:latest image as follows:

$ docker run --rm mplatform/mquery mplatform/mquery:latest
Image: mplatform/mquery:latest (digest: sha256:d0989420b6f0d2b929fd9355f15c767f62d0e9a72cdf999d1eb16e6073782c71)
 * Manifest List: Yes (Image type: application/vnd.docker.distribution.manifest.list.v2+json)
 * Supported platforms:
   - linux/ppc64le
   - linux/amd64
   - linux/386
   - linux/s390x
   - linux/riscv64
   - linux/arm64/v8
   - linux/arm/v7
   - linux/arm/v6
   - windows/amd64:10.0.17763.2300
   - windows/amd64:10.0.14393.4770

Using the mquery tool

This project also includes a tool for querying the Lambda API Gateway-fronted endpoint with a simple/readable output format for showing the list of platforms supported by a specific image. You can build the tool yourself using the Makefile, or you can use a pre-packaged multi-platform image on DockerHub as shown in the section above.

This Go program requires the github.com/dghubble/sling and github.com/opencontainers/image-spec/specs-go/v1 packages. You can add these to your Go development environment with:

$ go get -u github.com/dghubble/sling
$ go get -u github.com/opencontainers/image-spec/specs-go/v1

References

More information about manifest lists and multi-platform image support is available in these blog posts:

Also see the manifest-tool project for an easy to use tool for assembling and pushing manifest lists and OCI index images.

License

This project is licensed under the Apache Public License, v2.0.