manastech / ci-docker-builder

Scripts to facilitate building Docker images with right tags

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a label with the source code's commit version to the image

matiasgarciaisaia opened this issue · comments

Context

When using (mostly in staging) images tagged as latest, it's sometimes not that easy to check which version of the app's source code was used for the build. We usually create a VERSION file with that info (inside the image), but that's manually done outside of ci-docker-builder.

Potential solution 💡

We should add a LABEL to the built Docker image, annotating the source code version of the repo. We may think about adding the repo's URL/name, too.

Alternatives

I guess we should make this optional, thinking about not leaking repo's names or hashes, but I'm not sure about that.