-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.static
36 lines (26 loc) · 1.74 KB
/
Dockerfile.static
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM golang:1.22.4-alpine as go-builder
SHELL ["/bin/sh", "-ecuxo", "pipefail"]
RUN apk add --no-cache ca-certificates build-base linux-headers git gmp gmp-dev
WORKDIR /chain
COPY . /chain
RUN go mod download
#RUN GO_OWASM_VERSION=$(go list -m github.com/odin-protocol/go-owasm | cut -d ' ' -f 2) && \
# wget https://github.com/odin-protocol/go-owasm/releases/download/$GO_OWASM_VERSION/libgo_owasm_muslc.x86_64.a -O /lib/libgo_owasm_muslc.x86_64.a
#RUN sha256sum /lib/libgo_owasm_muslc.x86_64.a | grep b4ebce01c2c742c32ba0312793ea3936e4738c50362a631a47b1e42bff878e5d
# Copy the library you want to the final location that will be found by the linker flag `-lgo_owasm_muslc`
#RUN cp /lib/libgo_owasm_muslc.x86_64.a /lib/libgo_owasm_muslc.a
ADD https://github.com/ODIN-PROTOCOL/wasmvm/releases/download/v2.0.18/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/ODIN-PROTOCOL/wasmvm/releases/download/v2.0.18/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
#RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 860ba8d7ee4c89c1b0dc3abd4b3658d07ddf5531d2de970cada0699689cc1e33
#RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 85de2ab3c40236935dbd023c9211130d49c5464494c4b9b09ea33e27a2d6bf87
# force it to use static lib (from above) not standard libgo_owasm.so file
RUN LEDGER_ENABLED=true BUILD_TAGS=muslc LINK_STATICALLY=true make install \
&& echo "Ensuring binary is statically linked ..." \
&& (file /go/bin/odind | grep "statically linked")
#RUN go test ./...
# --------------------------------------------------------
FROM alpine:3.16
COPY --from=go-builder /go/bin/odind /usr/bin/odind
COPY --from=go-builder /go/bin/yoda /usr/bin/yoda
COPY --from=go-builder /go/bin/kvasir /usr/bin/kvasir
ENTRYPOINT ["/usr/bin/odind"]