Docker image tagging with git version

Hi All i need help in docker image taging with my output from GIT version .

Like if my git version is v.1.2 , my docker image tag should imagename:v.1.2.DEV

kindly help me with code. or mail me on samirkumaram@gmail.com
Urgent