CMD to check if an image is already pushed to registry.fly.io registry

Hello!

Is there any cmd to check if a docker image is already pushed to registry.fly.io container registry?

Thanks!

1 Like

You can use the docker registry API to check if a manifest exists:

curl \
  -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
  -H "Authorization: Bearer $(fly auth token)" \
  "https://registry.fly.io/v2/$FLY_APP/manifests/$TAG"

If you want to test if the remote image is the same as the local image, you can compare the config.digest field of the response with the Id field in the output of docker image inspect ....

2 Likes

Oh that should work, thanks!