From 92d213d2c1ab36260c9f19e29459980d2629cbe6 Mon Sep 17 00:00:00 2001 From: Alex Laties Date: Wed, 26 Jun 2019 17:50:29 -0400 Subject: [PATCH] allow for VERSION and REVISION to be passed in during docker builds Signed-off-by: Alex Laties --- Dockerfile | 2 ++ Makefile | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f4602d01..655c0436 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,8 @@ ENV DOCKER_BUILDTAGS include_oss include_gcs ARG GOOS=linux ARG GOARCH=amd64 ARG GOARM=6 +ARG VERSION +ARG REVISION RUN set -ex \ && apk add --no-cache make git file diff --git a/Makefile b/Makefile index 4635c6ec..fbaffa66 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,8 @@ ROOTDIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST)))) # Used to populate version variable in main package. -VERSION=$(shell git describe --match 'v[0-9]*' --dirty='.m' --always) -REVISION=$(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi) +VERSION ?= $(shell git describe --match 'v[0-9]*' --dirty='.m' --always) +REVISION ?= $(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi) PKG=github.com/docker/distribution