From 7c7422c1447d3db6f5e2753b7b9c9b337c736c64 Mon Sep 17 00:00:00 2001
From: Will McCutchen <will@mccutch.org>
Date: Wed, 28 Jun 2017 23:12:36 -0700
Subject: [PATCH] Tag docker images with commit hash, for now

---
 Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index f6fa9d4..c4b68ee 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+commit := $(shell git rev-parse --short HEAD)
+
 build: dist/go-httpbin
 
 dist/go-httpbin: assets cmd/go-httpbin/*.go httpbin/*.go
@@ -28,7 +30,7 @@ image: assets cmd/go-httpbin/*.go httpbin/*.go
 	mkdir -p /tmp/go-httpbin-docker
 	cp Dockerfile /tmp/go-httpbin-docker
 	GOOS=linux GOARCH=amd64 go build -o /tmp/go-httpbin-docker/go-httpbin ./cmd/go-httpbin
-	docker build -t mccutchen/go-httpbin /tmp/go-httpbin-docker
+	docker build -t mccutchen/go-httpbin:$(commit) /tmp/go-httpbin-docker
 
 imagepush: image
-	docker push mccutchen/go-httpbin
+	docker push mccutchen/go-httpbin:$(commit)
-- 
GitLab