46 lines
1.9 KiB
Docker
46 lines
1.9 KiB
Docker
#syntax=docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc
|
|
FROM docker.io/library/rust:1.49@sha256:a50165ea96983c21832578afb1c8c028674c965bc1ed43b607871b1f362e06a5
|
|
|
|
RUN apt-get update && apt-get install -yq libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang ncat
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
|
|
|
|
RUN rustup default nightly-2021-08-01
|
|
RUN rustup component add rustfmt
|
|
|
|
RUN --mount=type=cache,target=/root/.cache \
|
|
cargo install --version =1.7.0 solana-cli && \
|
|
cargo install --version =2.0.12 spl-token-cli
|
|
|
|
ADD ethereum /usr/src/ethereum
|
|
WORKDIR /usr/src/ethereum
|
|
RUN --mount=type=cache,target=/usr/src/ethereum/node_modules \
|
|
npm install
|
|
|
|
ADD clients/token_bridge /usr/src/clients/token_bridge
|
|
WORKDIR /usr/src/clients/token_bridge
|
|
RUN --mount=type=cache,target=/usr/src/ethereum/node_modules \
|
|
--mount=type=cache,target=/usr/src/clients/token_bridge/node_modules \
|
|
npm install && \
|
|
npm run build-contracts && \
|
|
npm run build && \
|
|
cp -r node_modules node_modules_cached
|
|
|
|
RUN rm -rf node_modules && mv node_modules_cached node_modules # Make cached node_modules part of the image
|
|
|
|
ADD solana /usr/src/solana
|
|
ADD proto /usr/src/proto
|
|
|
|
WORKDIR /usr/src/solana
|
|
ENV EMITTER_ADDRESS="11111111111111111111111111111115"
|
|
|
|
RUN --mount=type=cache,target=/root/.cache \
|
|
--mount=type=cache,target=target \
|
|
--mount=type=cache,target=bridge/target \
|
|
--mount=type=cache,target=modules/token_bridge/target \
|
|
cargo build --manifest-path ./bridge/Cargo.toml --package client --release && \
|
|
cargo build --manifest-path ./modules/token_bridge/Cargo.toml --package client --release && \
|
|
cp /usr/local/cargo/bin/solana /usr/local/bin && \
|
|
cp /usr/local/cargo/bin/spl-token /usr/local/bin && \
|
|
cp bridge/target/release/client /usr/local/bin && \
|
|
cp modules/token_bridge/target/release/client /usr/local/bin/token-bridge-client
|