2021-08-16 06:09:51 -07:00
|
|
|
#syntax=docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc
|
2021-02-12 04:48:44 -08:00
|
|
|
FROM docker.io/library/rust:1.49@sha256:a50165ea96983c21832578afb1c8c028674c965bc1ed43b607871b1f362e06a5
|
2020-08-15 13:14:24 -07:00
|
|
|
|
2021-08-06 06:46:09 -07:00
|
|
|
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
|
2022-03-10 17:19:22 -08:00
|
|
|
RUN curl -sSfL https://release.solana.com/v1.9.4/install | sh
|
2021-08-16 06:09:51 -07:00
|
|
|
|
2022-01-13 05:29:19 -08:00
|
|
|
RUN rustup default nightly-2022-01-02
|
2020-08-15 13:14:24 -07:00
|
|
|
RUN rustup component add rustfmt
|
|
|
|
|
2021-08-16 06:09:51 -07:00
|
|
|
RUN --mount=type=cache,target=/root/.cache \
|
|
|
|
cargo install --version =2.0.12 spl-token-cli
|
|
|
|
|
2021-08-04 04:46:07 -07:00
|
|
|
ENV SOLANA_BIN_PATH="/root/.local/share/solana/install/active_release/bin"
|
|
|
|
ENV PATH="$SOLANA_BIN_PATH:$PATH"
|
|
|
|
|
2021-08-06 06:46:09 -07:00
|
|
|
WORKDIR /usr/src/clients/token_bridge
|
2022-02-11 20:01:11 -08:00
|
|
|
COPY clients/token_bridge/package.json clients/token_bridge/package-lock.json ./
|
|
|
|
RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
|
|
|
|
npm ci
|
|
|
|
COPY clients/token_bridge ./
|
2022-02-13 18:47:38 -08:00
|
|
|
RUN npm run build
|
2020-08-15 13:14:24 -07:00
|
|
|
|
2021-08-31 01:28:51 -07:00
|
|
|
WORKDIR /usr/src/clients/nft_bridge
|
2022-02-11 20:01:11 -08:00
|
|
|
COPY clients/nft_bridge/package.json clients/nft_bridge/package-lock.json ./
|
|
|
|
RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
|
|
|
|
npm ci
|
|
|
|
COPY clients/nft_bridge ./
|
2022-02-13 18:47:38 -08:00
|
|
|
RUN npm run build
|
2021-08-04 04:46:07 -07:00
|
|
|
|
2020-08-15 13:14:24 -07:00
|
|
|
ADD solana /usr/src/solana
|
2021-08-04 04:46:07 -07:00
|
|
|
ADD proto /usr/src/proto
|
2020-08-15 13:14:24 -07:00
|
|
|
|
2021-08-06 06:46:09 -07:00
|
|
|
WORKDIR /usr/src/solana
|
2021-08-04 04:46:07 -07:00
|
|
|
|
|
|
|
RUN solana config set --keypair "/usr/src/solana/keys/solana-devnet.json"
|
|
|
|
RUN solana config set --url "http://solana-devnet:8899"
|
|
|
|
|
2021-07-02 10:59:59 -07:00
|
|
|
ENV EMITTER_ADDRESS="11111111111111111111111111111115"
|
2021-08-23 00:39:24 -07:00
|
|
|
ENV BRIDGE_ADDRESS="Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"
|
2021-07-02 10:59:59 -07:00
|
|
|
|
2021-08-16 06:09:51 -07:00
|
|
|
RUN --mount=type=cache,target=/root/.cache \
|
2021-06-23 06:38:59 -07:00
|
|
|
--mount=type=cache,target=bridge/target \
|
2021-08-02 12:27:10 -07:00
|
|
|
--mount=type=cache,target=modules/token_bridge/target \
|
2021-08-22 12:52:48 -07:00
|
|
|
set -xe && \
|
2022-02-18 03:48:10 -08:00
|
|
|
cargo build --manifest-path ./bridge/Cargo.toml --package client --release --locked && \
|
|
|
|
cargo build --manifest-path ./modules/token_bridge/Cargo.toml --package client --release --locked && \
|
2021-08-02 12:27:10 -07:00
|
|
|
cp bridge/target/release/client /usr/local/bin && \
|
|
|
|
cp modules/token_bridge/target/release/client /usr/local/bin/token-bridge-client
|