|
| 1 | +## This image is used to github action runner for this repo |
| 2 | +# Use the official Golang image as the base image |
| 3 | +FROM golang:1.22-bullseye AS builder |
| 4 | + |
| 5 | +# Set the working directory inside the container |
| 6 | +WORKDIR /app |
| 7 | + |
| 8 | +# Install Git |
| 9 | +RUN apt-get update && apt-get install -y git |
| 10 | + |
| 11 | +# Clone the repositories |
| 12 | +RUN git clone https://github.com/filecoin-project/boost.git |
| 13 | +RUN git clone https://github.com/filecoin-project/curio.git |
| 14 | + |
| 15 | +# Download Go dependencies for Boost |
| 16 | +WORKDIR /app/boost |
| 17 | +RUN git submodule update --init |
| 18 | +RUN go mod download |
| 19 | + |
| 20 | +# Download Go dependencies for Curio |
| 21 | +WORKDIR /app/boost |
| 22 | +RUN git submodule update --init |
| 23 | +RUN go mod download |
| 24 | + |
| 25 | +# Stage 2: Install Lotus binary |
| 26 | +FROM ghcr.io/filecoin-shipyard/lotus-containers:lotus-v1.28.1-devnet AS lotus-test |
| 27 | + |
| 28 | +# Stage 3: Build the final image |
| 29 | +FROM myoung34/github-runner AS curio-github-runner |
| 30 | + |
| 31 | +# Copy Go dependencies from the builder stage |
| 32 | +COPY --from=builder /go/pkg /go/pkg |
| 33 | +COPY --from=builder /go/bin /go/bin |
| 34 | +COPY --from=lotus-test /usr/local/bin/lotus /usr/local/bin/ |
| 35 | + |
| 36 | +RUN apt update && apt install -y \ |
| 37 | + build-essential \ |
| 38 | + bzr pkg-config \ |
| 39 | + clang \ |
| 40 | + curl \ |
| 41 | + gcc git \ |
| 42 | + hwloc \ |
| 43 | + jq \ |
| 44 | + libhwloc-dev wget \ |
| 45 | + mesa-opencl-icd \ |
| 46 | + ocl-icd-opencl-dev |
| 47 | + |
| 48 | +ENV RUSTUP_HOME=/usr/local/rustup \ |
| 49 | + CARGO_HOME=/usr/local/cargo \ |
| 50 | + PATH=/usr/local/cargo/bin:$PATH \ |
| 51 | + RUST_VERSION=1.76.0 |
| 52 | + |
| 53 | +RUN set -eux; \ |
| 54 | + dpkgArch="$(dpkg --print-architecture)"; \ |
| 55 | + case "${dpkgArch##*-}" in \ |
| 56 | + amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db' ;; \ |
| 57 | + armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='f21c44b01678c645d8fbba1e55e4180a01ac5af2d38bcbd14aa665e0d96ed69a' ;; \ |
| 58 | + arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800' ;; \ |
| 59 | + i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='e7b0f47557c1afcd86939b118cbcf7fb95a5d1d917bdd355157b63ca00fc4333' ;; \ |
| 60 | + *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ |
| 61 | + esac; \ |
| 62 | + url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init"; \ |
| 63 | + wget "$url"; \ |
| 64 | + echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ |
| 65 | + chmod +x rustup-init; \ |
| 66 | + ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ |
| 67 | + rm rustup-init; \ |
| 68 | + chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ |
| 69 | + rustup --version; \ |
| 70 | + cargo --version; \ |
| 71 | + rustc --version; |
| 72 | + |
| 73 | +# Allow attaching a volume for the specified path |
| 74 | +VOLUME /var/tmp/filecoin-proof-parameters |
0 commit comments