How to add git commit hash or any other dynamically inferred value in Dockerfile.
LABEL vcs-ref=$(git rev-parse --short HEAD)
Something like this?
I found it atlast,
use docker build --build-arg vcs-ref=$(git rev-parse --short HEAD)
while building.
But have to initialize the variable in vcs-ref in Dockerfile
ARG vcs-ref=0
ENV vcs-ref=$vcs-ref
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With