-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
64 lines (46 loc) · 1.65 KB
/
Dockerfile
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
ARG CORE_VERSION=latest
FROM ubuntu:20.04 as build
ENV TZ="Etc/UTC"
RUN apt-get update -qq
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
cmake \
g++ \
pkg-config \
libssl-dev \
curl \
llvm \
clang \
&& rm -rf /var/lib/apt/lists/*
COPY ./rust-toolchain.toml /tmp/rust-toolchain.toml
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
RUN curl https://sh.rustup.rs -sSf | \
sh -s -- -y --no-modify-path --default-toolchain none
COPY . .
RUN CARGO_TARGET_DIR=/tmp/target make release
RUN ls -la /tmp/target
RUN ls -la /tmp/target/release
FROM ubuntu:20.04
ENV TZ="Etc/UTC"
RUN apt-get update -qq
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
RUN DEBIAN_FRONTEND=noninteractive \
apt-get -y install -y \
ca-certificates libssl-dev vim htop iotop sysstat wget \
dstat strace lsof curl jq tzdata && \
rm -rf /var/cache/apt /var/lib/apt/lists/*
RUN rm /etc/localtime && ln -snf /usr/share/zoneinfo/America/Montreal /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
# s5cmd is a CLI tool to manipulate S3 store (Needed to sync NEAR Foundation backup(s))
RUN mkdir /tmp/s5cmd && \
cd /tmp/s5cmd && \
wget -O s5cmd.tar.gz https://github.com/peak/s5cmd/releases/download/v2.0.0/s5cmd_2.0.0_Linux-64bit.tar.gz && \
tar -xzvf s5cmd.tar.gz && \
cp s5cmd /usr/bin/ && \
cd / && \
rm -rf /tmp/s5cmd
COPY --from=build /tmp/target/release/near-firehose-indexer /app/near-firehose-indexer
RUN chmod +x /app/near-firehose-indexer
ENV PATH "$PATH:/app"