Skip to content

Commit 65c482b

Browse files
committed
Add deterministic linux amd64 build system
1 parent b8c5724 commit 65c482b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Makefile

+18
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ LEDGER_ENABLED ?= true
77
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
88
BINDIR ?= $(GOPATH)/bin
99
SIMAPP = ./app
10+
BUILDDIR ?= $(CURDIR)/build
1011

1112
# for dockerized protobuf tools
1213
DOCKER := $(shell which docker)
@@ -73,6 +74,23 @@ ldflags := $(strip $(ldflags))
7374

7475
BUILD_FLAGS := -tags "$(build_tags_comma_sep)" -ldflags '$(ldflags)' -trimpath
7576

77+
build-reproducible-amd64: go.sum $(BUILDDIR)/
78+
$(DOCKER) buildx create --name wasmbuilder || true
79+
$(DOCKER) buildx use wasmbuilder
80+
$(DOCKER) buildx build \
81+
--build-arg GO_VERSION=$(GO_VERSION) \
82+
--build-arg GIT_VERSION=$(VERSION) \
83+
--build-arg GIT_COMMIT=$(COMMIT) \
84+
--build-arg RUNNER_IMAGE=alpine:3.16 \
85+
--platform linux/amd64 \
86+
-t wasmd:local-amd64 \
87+
--load \
88+
-f Dockerfile .
89+
$(DOCKER) rm -f temp || true
90+
$(DOCKER) create -ti --name temp wasmd:local-amd64
91+
$(DOCKER) cp temp:/usr/bin/wasmd $(BUILDDIR)/wasmd-linux-amd64
92+
$(DOCKER) rm -f temp
93+
7694
# The below include contains the tools and runsim targets.
7795
include contrib/devtools/Makefile
7896

0 commit comments

Comments
 (0)