Dockerfile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. FROM ubuntu:20.04 as builder
  2. LABEL org.opencontainers.image.licenses="Apache-2.0" \
  3. org.opencontainers.image.description="CI container for Hyperledger Solang github actions"
  4. ENV DEBIAN_FRONTEND=noninteractive
  5. RUN apt-get update -y
  6. RUN apt-get upgrade -y
  7. RUN apt-get install -y libz-dev pkg-config libssl-dev git cmake ninja-build gcc g++ python3
  8. RUN git clone --single-branch --branch solana-rustc/14.0-2022-03-22 \
  9. https://github.com/solana-labs/llvm-project.git
  10. WORKDIR /llvm-project
  11. RUN cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off \
  12. -DLLVM_ENABLE_PROJECTS=clang\;lld \
  13. -DLLVM_TARGETS_TO_BUILD=WebAssembly\;BPF \
  14. -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/llvm14.0 llvm
  15. RUN cmake --build . --target install
  16. FROM ubuntu:20.04
  17. ENV DEBIAN_FRONTEND=noninteractive
  18. RUN apt-get update
  19. RUN apt-get install -y zlib1g-dev pkg-config libssl-dev git libffi-dev curl gcc g++ make python3
  20. RUN apt-get clean
  21. RUN apt-get autoclean
  22. # Get Rust
  23. RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.63.0
  24. COPY --from=builder /llvm14.0 /llvm14.0/
  25. ENV PATH="/llvm14.0/bin:/root/.cargo/bin:/root/.local/share/solana/install/active_release/bin:${PATH}"
  26. # Install Solana (x86-64 only, does not work on arm)
  27. RUN if test `arch` = x86_64; then sh -c "$(curl -sSfL https://release.solana.com/v1.11.10/install)"; fi
  28. # Install Anchor tools
  29. RUN cargo install --git https://github.com/coral-xyz/anchor --tag v0.25.0 anchor-cli