diff --git a/Dockerfile b/Dockerfile index 0b1fe636..6749526b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ COPY . . RUN go mod download #install binary -RUN make install +RUN DOCKER=true make install #build main container FROM alpine:latest diff --git a/Dockerfile.nonroot b/Dockerfile.nonroot index 95638ba3..90ddfae6 100644 --- a/Dockerfile.nonroot +++ b/Dockerfile.nonroot @@ -19,7 +19,7 @@ COPY . . RUN go mod download #install binary -RUN make install +RUN DOCKER=true make install #build main container FROM alpine:latest diff --git a/Makefile b/Makefile index 491b895a..d1be7dca 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ GIT_COMMIT = $(shell git rev-parse --short HEAD) BUILD_DATE = $(shell date -u "+%Y%m%d-%H%M") VERSION_PKG = github.com/InjectiveLabs/peggo/orchestrator/version IMAGE_NAME := gcr.io/injective-core/peggo +DOCKER ?= false all: @@ -18,9 +19,7 @@ push: install: export GOPROXY=direct install: export VERSION_FLAGS="-X $(VERSION_PKG).GitCommit=$(GIT_COMMIT) -X $(VERSION_PKG).BuildDate=$(BUILD_DATE)" install: - go install \ - -ldflags $(VERSION_FLAGS) \ - ./cmd/... + $(DOCKER) && go install -tags muslc -ldflags $(VERSION_FLAGS) ./cmd/... || go install -ldflags $(VERSION_FLAGS) ./cmd/... .PHONY: install image push test gen