forked from sei-protocol/sei-chain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.sf
68 lines (48 loc) · 3.01 KB
/
Dockerfile.sf
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM ubuntu:22.04 AS base
WORKDIR /app
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg tar jq vim wget
RUN curl -LO https://github.com/chmln/sd/releases/download/v1.0.0/sd-v1.0.0-x86_64-unknown-linux-gnu.tar.gz \
&& tar -xzf sd-v1.0.0-x86_64-unknown-linux-gnu.tar.gz \
&& cp sd-v1.0.0-x86_64-unknown-linux-gnu/sd /usr/local/bin/sd \
&& rm -rf sd-v1.0.0-x86_64-unknown-linux-gnu sd-v1.0.0-x86_64-unknown-linux-gnu.tar.gz
ENV PATH="/app:${PATH}"
FROM base AS fireeth_download
ARG FIREETH="v2.6.7"
# Download and extract the binary file
RUN curl -LO https://github.com/streamingfast/firehose-ethereum/releases/download/${FIREETH}/firehose-ethereum_linux_x86_64.tar.gz \
&& tar -xzf firehose-ethereum_linux_x86_64.tar.gz \
&& rm firehose-ethereum_linux_x86_64.tar.gz
FROM golang:1.22-alpine AS libwasmvm_download
COPY ./go.mod /work/go.mod
COPY ./go.sum /work/go.sum
# FIXME: Handle multi-arch build, for now we have hard-coded the x86_64 part, but we should be able to build for arm64 as well
RUN apk add --no-cache wget && cd /work; \
export ARCH=$(uname -m); \
# Currently github.com/CosmWasm/wasmvm is being overriden by github.com/sei-protocol/sei-wasmvm
# (see go.mod). However the rust precompiles are still fetched from the upstream repository.
# Here we assume that the sei-wasm release version is prefixed with the wasmvm release version
# with the matching precompiles. Therefore, to compute the download url, we just strip the suffix
# of the sei-wasm release version.
export WASM_VERSION=$(go list -f {{.Replace.Version}} -m github.com/CosmWasm/wasmvm | sed s/-.*//); \
wget -O "/lib/libwasmvm.x86_64.${WASM_VERSION}.so" https://github.com/CosmWasm/wasmvm/releases/download/${WASM_VERSION}/libwasmvm.x86_64.so && \
printf "${WASM_VERSION}" > /lib/libwasmvm.x86_64.so.version
FROM base AS cosmovisor_download
ARG COSMOVISOR="v1.5.0"
# Download and extract the binary file
RUN curl -LO https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2F${COSMOVISOR}/cosmovisor-${COSMOVISOR}-linux-amd64.tar.gz \
&& tar -xzf cosmovisor-${COSMOVISOR}-linux-amd64.tar.gz \
&& rm cosmovisor-${COSMOVISOR}-linux-amd64.tar.gz
FROM base AS base_with_gcloud
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg \
&& apt-get update -y \
&& apt-get install google-cloud-sdk -y
FROM base_with_gcloud
ARG SEID_BIN="seid"
COPY --from=fireeth_download /app/fireeth /app/fireeth
COPY --from=libwasmvm_download /lib/libwasmvm.x86_64.*.so /lib/
COPY --from=libwasmvm_download /lib/libwasmvm.x86_64.so.version /lib/
COPY ./${SEID_BIN} /app/seid
RUN chmod +x /app/fireeth && \
export WASM_VERSION=$(cat /lib/libwasmvm.x86_64.so.version) && \
ln -s /lib/libwasmvm.x86_64.${WASM_VERSION}.so /lib/libwasmvm.x86_64.so