Skip to content

Commit

Permalink
Upgrade wasmvm to v0.16.6 (#712)
Browse files Browse the repository at this point in the history
* dep: upgrade wasmvm to 0.16.7
build: use mimalloc for musl static build

* dep: wasmvm 0.16.6
  • Loading branch information
hanjukim authored Apr 8, 2022
1 parent dbd6c54 commit 8a7a47d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,31 @@
FROM golang:1.17.8-alpine3.15 AS go-builder

# See https://github.com/CosmWasm/wasmvm/releases
ENV LIBWASMVM_VERSION=0.16.3
ENV LIBWASMVM_SHA256=3fc6d5a239f3e97ac96c1a2df3006e4107ca461da4ca318bc71cfdc3e3593125
ENV LIBWASMVM_VERSION=0.16.6
ENV LIBWASMVM_SHA256=fe63ff6bb75cad9116948d96344391d6786b6009d28e7016a85e1a268033d8f8

# 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
RUN apk add git cmake
# NOTE: add these to run with LEDGER_ENABLED=true
# RUN apk add libusb-dev linux-headers

WORKDIR /code
COPY . /code/

# Install mimalloc
RUN git clone --depth 1 https://github.com/microsoft/mimalloc; cd mimalloc; mkdir build; cd build; cmake ..; make -j$(nproc); make install
ENV MIMALLOC_RESERVE_HUGE_OS_PAGES=4

# See https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/v${LIBWASMVM_VERSION}/libwasmvm_muslc.a /lib/libwasmvm_muslc.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v${LIBWASMVM_VERSION}/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.a
RUN sha256sum /lib/libwasmvm_muslc.a | grep ${LIBWASMVM_SHA256}

# force it to use static lib (from above) not standard libgo_cosmwasm.so file
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc make build
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LDFLAGS="-extldflags \"-L/code/mimalloc/build -lmimalloc -static\"" make build

FROM alpine:3.15.4

Expand Down

0 comments on commit 8a7a47d

Please sign in to comment.