77 lines
3.0 KiB
Docker
77 lines
3.0 KiB
Docker
#syntax=docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc
|
|
FROM pythfoundation/pyth-client:devnet-v2.20.0 as pyth-oracle-copy
|
|
|
|
FROM docker.io/library/rust:1.49@sha256:a50165ea96983c21832578afb1c8c028674c965bc1ed43b607871b1f362e06a5 as build
|
|
|
|
RUN apt-get update\
|
|
&& apt-get install -y \
|
|
clang \
|
|
libudev-dev \
|
|
libssl-dev \
|
|
llvm \
|
|
pkg-config \
|
|
zlib1g-dev \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& rustup component add rustfmt
|
|
|
|
RUN sh -c "$(curl -sSfL https://release.solana.com/v1.10.31/install)"
|
|
|
|
ENV PATH="/root/.local/share/solana/install/active_release/bin:$PATH"
|
|
|
|
|
|
ADD wormhole_attester/rust-toolchain /rust-toolchain
|
|
|
|
USER root
|
|
# Solana does a questionable download at the beginning of a *first* build-bpf call. Trigger and layer-cache it explicitly.
|
|
RUN cargo init --lib /tmp/decoy-crate && \
|
|
cd /tmp/decoy-crate \
|
|
&& echo '[lib]\nname=decoy_crate\ncrate-type=["cdylib"]' >> /tmp/decoy-crate/Cargo.toml # Make a more plausible decoy crate with real cdylib target \
|
|
&& cargo build-bpf \
|
|
&& rm -rf /tmp/decoy-crate
|
|
|
|
WORKDIR /usr/src/bridge
|
|
|
|
ARG WORMHOLE_REV=2.14.8
|
|
ADD https://github.com/wormhole-foundation/wormhole/archive/refs/tags/v${WORMHOLE_REV}.tar.gz .
|
|
RUN tar -xvf v${WORMHOLE_REV}.tar.gz
|
|
RUN mv wormhole-${WORMHOLE_REV} wormhole
|
|
|
|
WORKDIR /usr/src/squads
|
|
|
|
ARG SQUADS_REV=1.2.0
|
|
ADD https://github.com/Squads-Protocol/squads-mpl/archive/refs/tags/v${SQUADS_REV}.tar.gz .
|
|
|
|
RUN tar -xvf v${SQUADS_REV}.tar.gz
|
|
RUN mv squads-mpl-${SQUADS_REV} squads-mpl
|
|
|
|
WORKDIR /usr/src/
|
|
|
|
ADD wormhole_attester wormhole_attester
|
|
ADD governance/remote_executor governance/remote_executor
|
|
RUN mkdir -p /opt/solana/deps
|
|
|
|
ENV EMITTER_ADDRESS="11111111111111111111111111111115"
|
|
ENV BRIDGE_ADDRESS="Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"
|
|
|
|
WORKDIR /usr/src
|
|
|
|
# Build Wormhole Solana programs
|
|
RUN --mount=type=cache,target=/usr/src/bridge/wormhole/solana/target \
|
|
--mount=type=cache,target=/usr/src/wormhole_attester/target \
|
|
--mount=type=cache,target=/usr/src/squads/squads-mpl/target \
|
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
|
--mount=type=cache,target=/root/.cache \
|
|
cargo build-bpf --manifest-path "bridge/wormhole/solana/bridge/program/Cargo.toml" -- --locked && \
|
|
cargo build-bpf --manifest-path "wormhole_attester/program/Cargo.toml" -- --locked && \
|
|
cargo build-bpf --manifest-path "squads/squads-mpl/programs/mesh/Cargo.toml" -- --locked && \
|
|
cp bridge/wormhole/solana/target/deploy/bridge.so /opt/solana/deps/bridge.so && \
|
|
cp wormhole_attester/target/deploy/pyth_wormhole_attester.so /opt/solana/deps/pyth_wormhole_attester.so && \
|
|
cp squads/squads-mpl/target/deploy/mesh.so /opt/solana/deps/mesh.so
|
|
|
|
COPY --from=pyth-oracle-copy /home/pyth/pyth-client/target/deploy/pyth_oracle.so /opt/solana/deps/pyth_oracle.so
|
|
|
|
ENV RUST_LOG="solana_runtime::system_instruction_processor=trace,solana_runtime::message_processor=trace,solana_bpf_loader=debug,solana_rbpf=debug"
|
|
ENV RUST_BACKTRACE=1
|
|
|
|
ADD tilt_devnet/secrets/solana /solana-secrets
|