When I run flyctl image show it shows me 5 fields: Registry, Repository, Tag, Version and Digest. e.g:
$ flyctl image show
Deployment Status
Registry = registry.hub.docker.com
Repository = shieldsio/shields
Tag = next
Version = N/A
Digest = sha256:f9b96cd263cbb762aec7f43738591d6c820c19c713035e6ec7817854a1c64c9d
How is the Version field populated?
I took a guess based on
that this could be populated by setting LABEL fly.version in my Dockerfile
Sure. When I build my docker image, I pass a build arg which contains a version string. In the case of the next docker tag, its based on the git commit hash we’re building the image from:
Ideally I’d like to be able to surface this value when I run flyctl image show. The high level objective is I’d like to be able to easily answer the question “which git commit in my repo does the docker image currently deployed on fly.io correspond to?” - if there’s another approach we could use, then I’m happy to hear it. Thanks
Ah, okay, unfortunately that version tracking is only available for images Fly creates at the moment (Postgres and Livebook) and isn’t available for custom images.