How to manage image version


I would like to use Gitlab CI / CD to build & push images to a private registry.

Problem : I don’t know how to manage the version of the images.

There are many possibilities and I don’t know which one to choose:

  • Have a VERSION file at the root of the repository
  • Use the hash of the commit

What is the best practice?

Thank you!

1 Like

I use some like

    - apk add jq git
    - export VERSION=$(jq -r .version package.json)

but there exist many ways, surly easy to find with google