From 794b4efef38534e77d54d230a90dd5138b6fe1f9 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 19 Nov 2020 15:27:53 +0100 Subject: [PATCH 1/4] Upgrade CosmWasm/wasmvm to v0.12.0 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e36b4521266..3b03e8105da 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/CosmWasm/wasmd go 1.15 require ( - github.com/CosmWasm/wasmvm v0.12.0-alpha1 + github.com/CosmWasm/wasmvm v0.12.0 github.com/cosmos/cosmos-sdk v0.40.0-rc3 github.com/cosmos/iavl v0.15.0-rc4 github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b diff --git a/go.sum b/go.sum index 83eb915fec3..f33dd43e83c 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CosmWasm/wasmvm v0.12.0-alpha1 h1:UPaemjM+O/9uQRDCiExXPpcUlMJ5Zo8N/BUvqjheb5A= -github.com/CosmWasm/wasmvm v0.12.0-alpha1/go.mod h1:tbXGE9Jz6sYpiJroGr71OQ5TFOufq/P5LWsruA2u6JE= +github.com/CosmWasm/wasmvm v0.12.0 h1:L9ez6fCg2Co1SgCm0YHjbnewZ8myemu2cm/QL0qR1OE= +github.com/CosmWasm/wasmvm v0.12.0/go.mod h1:tbXGE9Jz6sYpiJroGr71OQ5TFOufq/P5LWsruA2u6JE= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= From 9f1d07e5390ce5431631bb8bc04f04d2c686f27e Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 19 Nov 2020 15:41:45 +0100 Subject: [PATCH 2/4] Add .dockerignore --- .dockerignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000000..3f239d40fd0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +# Folders we don't want to copy to Docker daemon in `docker build . -t cosmwasm/wasmd:latest` +build/ From cb20a7b3b05d7bd9b61da19e76d553e78119c50a Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 19 Nov 2020 15:47:54 +0100 Subject: [PATCH 3/4] Use libwasmvm_muslc.a from Github --- Dockerfile | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1180a966e55..ea28ed21814 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,11 @@ # docker build . -t cosmwasm/wasmd:latest # docker run --rm -it cosmwasm/wasmd:latest /bin/sh -FROM cosmwasm/go-ext-builder:0002-alpine AS rust-builder +FROM golang:1.14-alpine3.12 AS go-builder -RUN apk add git - -# copy all code into /code -WORKDIR /code -COPY go.* /code/ - -# download all deps -RUN go mod download github.com/CosmWasm/wasmvm - -# build wasmvm *.a and install it -RUN export GO_WASM_DIR=$(go list -f "{{ .Dir }}" -m github.com/CosmWasm/wasmvm) && \ - cd ${GO_WASM_DIR} && \ - cargo build --release --features backtraces --example muslc && \ - mv ${GO_WASM_DIR}/target/release/examples/libmuslc.a /lib/libwasmvm_muslc.a - -# -------------------------------------------------------- -FROM cosmwasm/go-ext-builder:0002-alpine AS go-builder +# this comes from standard alpine nightly file +# https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile +# with some changes to support our toolchain, etc +RUN set -eux; apk add --no-cache ca-certificates build-base; RUN apk add git # NOTE: add these to run with LEDGER_ENABLED=true @@ -27,7 +14,9 @@ RUN apk add git WORKDIR /code COPY . /code/ -COPY --from=rust-builder /lib/libwasmvm_muslc.a /lib/libwasmvm_muslc.a +# See https://github.com/CosmWasm/wasmvm/releases +ADD https://github.com/CosmWasm/wasmvm/releases/download/v0.12.0/libwasmvm_muslc.a /lib/libwasmvm_muslc.a +RUN sha256sum /lib/libwasmvm_muslc.a | grep 00ee24fefe094d919f5f83bf1b32948b1083245479dad8ccd5654c7204827765 # force it to use static lib (from above) not standard libgo_cosmwasm.so file RUN LEDGER_ENABLED=false BUILD_TAGS=muslc make build From 07855f8c4b7324433032737dd42b9039e9b532ae Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 19 Nov 2020 15:48:29 +0100 Subject: [PATCH 4/4] Upgrade Go to 1.15 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ea28ed21814..4fc2dacda69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # docker build . -t cosmwasm/wasmd:latest # docker run --rm -it cosmwasm/wasmd:latest /bin/sh -FROM golang:1.14-alpine3.12 AS go-builder +FROM golang:1.15-alpine3.12 AS go-builder # this comes from standard alpine nightly file # https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile