Last active
July 29, 2021 08:58
-
-
Save justerror/bf64ce3d8f693fa587319185c3848039 to your computer and use it in GitHub Desktop.
Tagging Docker images with commit hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAME := your-registry.com/username/project-name | |
TAG := $$(git log -1 --pretty=%h) | |
IMG := ${NAME}:${TAG} | |
LATEST := ${NAME}:latest | |
build: | |
@docker build . -t ${IMG} --progress=plain | |
@docker tag ${IMG} ${LATEST} | |
push: | |
@docker push ${NAME} | |
login: | |
@docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} your-registry.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment