Files
wasmd/Dockerfile.alpine

55 lines
1.6 KiB
Docker

# docker build . -t wasm-alpine -f ./Dockerfile.alpine
# docker run --rm -it wasm-alpine /bin/sh
FROM cosmwasm/go-ext-builder:0.8.2-alpine AS builder
RUN apk add git
# without this, build with LEDGER_ENABLED=false
RUN apk add libusb-dev linux-headers
ENV GO_COSMWASM="v0.8.2-0.20200615215318-6f82d95b1cb6"
# copy all code into /code
WORKDIR /code
COPY . /code
# download all deps
RUN go mod download
RUN ls -ld /go/pkg/mod/github.com/\!cosm\!wasm/go-cosmwasm@v*
# build go-cosmwasm *.a and install it
WORKDIR /go/pkg/mod/github.com/\!cosm\!wasm/go-cosmwasm@${GO_COSMWASM}
RUN cargo build --release --features backtraces --example muslc
RUN cp /go/pkg/mod/github.com/\!cosm\!wasm/go-cosmwasm@${GO_COSMWASM}/target/release/examples/libmuslc.a /lib/libgo_cosmwasm_muslc.a
# build the go wasm binary
WORKDIR /code
# other build flags... netgo,ledger,...
# also all the other link flags
#ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=wasm \
# -X github.com/cosmos/cosmos-sdk/version.ServerName=wasmd \
# -X github.com/cosmos/cosmos-sdk/version.ClientName=wasmcli \
# -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
# -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
# -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"
RUN BUILD_TAGS=muslc make build
FROM alpine:3.12
COPY --from=builder /code/build/wasmd /usr/bin/wasmd
COPY --from=builder /code/build/wasmcli /usr/bin/wasmcli
COPY docker/* /opt/
RUN chmod +x /opt/*.sh
WORKDIR /opt
# rest server
EXPOSE 1317
# tendermint p2p
EXPOSE 26656
# tendermint rpc
EXPOSE 26657
CMD ["/usr/bin/wasmd version"]