fix git commit when using make docker (#1323)

* fix git commit when using `make docker`

* avoid warning about LATEST_COMMIT for linters in Docker
This commit is contained in:
Igor Mandrigin 2020-10-30 09:43:24 +01:00 committed by GitHub
parent 91871746b3
commit 1b2bf8bf61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,11 @@
FROM golang:1.15-alpine3.12 as builder
ARG git_commit
ENV GIT_COMMIT=$git_commit
# for linters to avoid warnings. we won't use linters in Docker anyway
ENV LATEST_COMMIT="undefined"
RUN apk --no-cache add make gcc g++ linux-headers git bash ca-certificates libgcc libstdc++
WORKDIR /app

View File

@ -7,7 +7,7 @@ ifeq ($(LATEST_COMMIT),)
LATEST_COMMIT := $(shell git log -n 1 HEAD~1 --pretty=format:"%H")
endif
GIT_COMMIT=$(shell git rev-list -1 HEAD)
GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
OS = $(shell uname -s)
ARCH = $(shell uname -m)
@ -22,10 +22,7 @@ endif
all: tg hack tester rpctest state pics rpcdaemon integration db-tools
docker:
docker build -t turbo-geth:latest .
docker-alltools:
docker build -t turbo-geth-alltools:latest -f Dockerfile.alltools .
docker build -t turbo-geth:latest --build-arg git_commit='${GIT_COMMIT}' .
docker-compose:
docker-compose up