File tree Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 1
1
# docker build . -t cosmwasm/wasmd:latest
2
2
# docker run --rm -it cosmwasm/wasmd:latest /bin/sh
3
3
FROM golang:1.17-alpine3.15 AS go-builder
4
+ ARG arch=x86_64
4
5
5
6
# this comes from standard alpine nightly file
6
7
# https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile
@@ -15,11 +16,18 @@ WORKDIR /code
15
16
COPY . /code/
16
17
17
18
# See https://github.com/CosmWasm/wasmvm/releases
18
- ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta7/libwasmvm_muslc.a /lib/libwasmvm_muslc.a
19
- RUN sha256sum /lib/libwasmvm_muslc.a | grep d0152067a5609bfdfb3f0d5d6c0f2760f79d5f2cd7fd8513cafa9932d22eb350
19
+ ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta9/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
20
+ ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta9/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
21
+ RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 922ca7aa0057da68ab49572c3d3294fb2b0d1eb12786276fdb2ca099058074b0
22
+ RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 2aed14e6d6f4df2a7a5d23cab4da13262e740ca51160cb9be1f2d86bd34292f2
23
+
24
+ # Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc`
25
+ RUN cp /lib/libwasmvm_muslc.${arch}.a /lib/libwasmvm_muslc.a
20
26
21
27
# force it to use static lib (from above) not standard libgo_cosmwasm.so file
22
- RUN LEDGER_ENABLED=false BUILD_TAGS=muslc make build
28
+ RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build
29
+ RUN echo "Ensuring binary is statically linked ..." \
30
+ && (file /code/build/wasmd | grep "statically linked" )
23
31
24
32
# --------------------------------------------------------
25
33
FROM alpine:3.15
Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=wasm \
65
65
ifeq ($(WITH_CLEVELDB ) ,yes)
66
66
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb
67
67
endif
68
+ ifeq ($(LINK_STATICALLY ) ,true)
69
+ ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static"
70
+ endif
68
71
ldflags += $(LDFLAGS )
69
72
ldflags := $(strip $(ldflags ) )
70
73
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/CosmWasm/wasmd
3
3
go 1.17
4
4
5
5
require (
6
- github.com/CosmWasm/wasmvm v1.0.0-beta7
6
+ github.com/CosmWasm/wasmvm v1.0.0-beta9
7
7
github.com/cosmos/cosmos-sdk v0.45.1
8
8
github.com/cosmos/iavl v0.17.3
9
9
github.com/cosmos/ibc-go/v2 v2.2.0
Original file line number Diff line number Diff line change @@ -70,8 +70,8 @@ github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi
70
70
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 /go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo =
71
71
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg =
72
72
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d /go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4 =
73
- github.com/CosmWasm/wasmvm v1.0.0-beta7 h1:hCa6P8tUTh8viabzeXfede5iPlopSav9Guh+hupXjvU =
74
- github.com/CosmWasm/wasmvm v1.0.0-beta7 /go.mod h1:y+yd9piV8KlrB7ISRZz1sDwH4UVm4Q9rEX9501dBNog =
73
+ github.com/CosmWasm/wasmvm v1.0.0-beta9 h1:yQJ3vQZxWyWGSyOYNvgTOMq+g8ZEB9f4OOy/2+XfYDo =
74
+ github.com/CosmWasm/wasmvm v1.0.0-beta9 /go.mod h1:y+yd9piV8KlrB7ISRZz1sDwH4UVm4Q9rEX9501dBNog =
75
75
github.com/DATA-DOG/go-sqlmock v1.5.0 /go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM =
76
76
github.com/DataDog/datadog-go v3.2.0+incompatible /go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ =
77
77
github.com/DataDog/zstd v1.4.1 /go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo =
You can’t perform that action at this time.
0 commit comments