Skip to content

Commit 9c5a1c0

Browse files
committed
modify the makefile
1 parent 23370dd commit 9c5a1c0

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,12 @@ COPY go.mod go.sum* ./
1818
RUN go mod download
1919

2020
COPY . .
21-
RUN LEDGER_ENABLED=false LINK_STATICALLY=true BUILD_TAGS=muslc make build
22-
RUN echo "Ensuring binary is statically linked ..." \
23-
&& file /src/app/build/gaiad | grep "statically linked" \
21+
RUN LEDGER_ENABLED=false LINK_STATICALLY=true BUILD_TAGS=muslc make release
2422

2523
# Add to a distroless container
26-
FROM alpine:$IMG_TAG
27-
RUN apk add --no-cache build-base jq
28-
RUN addgroup -g 1025 nonroot
29-
RUN adduser -D nonroot -u 1025 -G nonroot
24+
FROM gcr.io/distroless/cc:$IMG_TAG
3025
ARG IMG_TAG
3126
COPY --from=shentud-builder /go/bin/shentud /usr/local/bin/
3227
EXPOSE 26656 26657 1317 9090
33-
USER nonroot
3428

3529
ENTRYPOINT ["shentud", "start"]

Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ update-cli-docs: install
8686
@perl -pi -e "s|$$HOME|~|" docs/**/*.md
8787

8888
release: go.sum
89-
GOOS=linux go build $(BUILD_FLAGS) -o build/shentud ./app/shentud
90-
GOOS=windows go build $(BUILD_FLAGS) -o build/shentud.exe ./app/shentud
91-
GOOS=darwin go build $(BUILD_FLAGS) -o build/shentud-macos ./app/shentud
89+
GOOS=linux GOARCH=amd64 go build $(BUILD_FLAGS) -o build/shentud ./app/shentud
9290

9391
build: go.sum
9492
ifeq ($(OS),Windows_NT)
@@ -98,7 +96,7 @@ else
9896
endif
9997

10098
build-linux: go.sum
101-
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build
99+
CGO_ENABLED=1 LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build
102100

103101
########## Tools ##########
104102

@@ -206,7 +204,7 @@ start-localnet-ci:
206204
# include simulations
207205
include sims.mk
208206

209-
.PHONY: all build-linux install release release32 \
207+
.PHONY: all build-linux install release build \
210208
fix lint test cov coverage coverage.out image image.update \
211209
build-docker-shentunode localnet-start localnet-stop \
212210
docker-build-debug docker-build-hermes \

0 commit comments

Comments
 (0)