makefile: Add DOCKER_{UID,GID,TAG} make params (#4457)

Co-authored-by: 3np <3np@example.com>
This commit is contained in:
3nprob 2022-06-16 14:50:59 +00:00 committed by GitHub
parent 2e600316e3
commit a738a0dd51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -16,7 +16,9 @@ FROM docker.io/library/alpine:3.15
RUN apk add --no-cache ca-certificates libstdc++ tzdata
COPY --from=builder /app/build/bin/* /usr/local/bin/
RUN adduser -H -u 1000 -g 1000 -D erigon
ARG PUID=1000
ARG PGID=1000
RUN adduser -H -u ${PUID} -g ${PGID} -D erigon
RUN mkdir -p /home/erigon
RUN mkdir -p /home/erigon/.local/share/erigon
RUN chown -R erigon:erigon /home/erigon

View File

@ -4,6 +4,9 @@ GOBIN = $(CURDIR)/build/bin
GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
GIT_TAG ?= $(shell git describe --tags '--match=v*' --dirty)
DOCKER_UID ?= 1000
DOCKER_PID ?= 1000
DOCKER_TAG ?= thorax/erigon:latest
CGO_CFLAGS := $(shell $(GO) env CGO_CFLAGS) # don't loose default
CGO_CFLAGS += -DMDBX_FORCE_ASSERTIONS=1 # Enable MDBX's asserts by default in 'devel' branch and disable in 'stable'
@ -30,10 +33,12 @@ go-version:
fi
docker: git-submodules
DOCKER_BUILDKIT=1 docker build -t thorax/erigon:latest \
DOCKER_BUILDKIT=1 docker build -t ${DOCKER_TAG} \
--build-arg "BUILD_DATE=$(shell date -Iseconds)" \
--build-arg VCS_REF=${GIT_COMMIT} \
--build-arg VERSION=${GIT_TAG} \
--build-arg PUID=${DOCKER_UID} \
--build-arg PGID=${DOCKER_PID} \
${DOCKER_FLAGS} \
.