From 5134ff5c7ed74e33f08e9eeec12eae63271176cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 31 Jan 2021 00:01:43 +0100 Subject: [PATCH] docker build args. --- Dockerfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 12471e57..43a53213 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,10 +17,22 @@ RUN set -eux; \ apt-get clean -y; \ rm -rf /var/lib/apt/lists/* /var/cache/apt/* +ARG GIT_COMMIT=dev +ARG GIT_BRANCH=dev + # # build server COPY . . -RUN go get -v -t -d . && go build -tags browser -o bin/neko -i cmd/neko/main.go +RUN go get -v -t -d . && go build \ + -tags browser \ + -o bin/neko \ + -ldflags " \ + -s -w \ + -X 'demodesk/neko.buildDate=`date -u +'%Y-%m-%dT%H:%M:%SZ'`' \ + -X 'demodesk/neko.gitCommit=${GIT_COMMIT}' \ + -X 'demodesk/neko.gitBranch=${GIT_BRANCH}' \ + " \ + -i cmd/neko/main.go; # # Stage 2: Runtime.