forked from jito-foundation/geyser-grpc-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (40 loc) · 1.43 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
FROM rust:1.60-slim-bullseye
# keep rust version in sync to avoid re-downloading rust
# use https://github.com/solana-labs/solana/blob/db9fdf5811ecd8a84ea446591854974d386681ef/ci/rust-version.sh#L21
RUN set -x \
&& apt-get -qq update \
&& apt-get -qq -y install \
clang \
cmake \
libudev-dev \
unzip \
libssl-dev \
pkg-config \
zlib1g-dev \
curl \
&& rustup component add rustfmt \
&& rustup component add clippy \
&& rustc --version \
&& cargo --version
ENV PROTOC_VERSION 21.12
ENV PROTOC_ZIP protoc-$PROTOC_VERSION-linux-x86_64.zip
RUN curl -OL https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP \
&& unzip -o $PROTOC_ZIP -d /usr/local bin/protoc \
&& unzip -o $PROTOC_ZIP -d /usr/local include/* \
&& rm -f $PROTOC_ZIP
WORKDIR /geyser-grpc-plugin
COPY . .
RUN mkdir -p container-output
ARG ci_commit
ENV CI_COMMIT=$ci_commit
ARG features
# Uses docker buildkit to cache the image.
# /usr/local/cargo/git needed for crossbeam patch
RUN --mount=type=cache,mode=0777,target=/geyser-grpc-plugin/target \
--mount=type=cache,mode=0777,target=/usr/local/cargo/registry \
--mount=type=cache,mode=0777,target=/usr/local/cargo/git \
if [ -z "$features" ] ; then \
cargo build --release && cp target/release/libgeyser* ./container-output; \
else \
cargo build --release --features "$features" && cp target/release/libgeyser* ./container-output; \
fi