VERSION 0.7 docker: ARG tag=latest FROM gcr.io/distroless/static:nonroot WORKDIR /locus COPY +build/locus . COPY +build/content ./content # CBA USER root EXPOSE 1965 ENTRYPOINT ["./locus"] SAVE IMAGE --push fuwn/locus:$tag deps: ARG rustc="nightly-2024-02-01" FROM clux/muslrust:$rustc RUN curl "https://static.rust-lang.org/rustup/archive/${RUSTUP_VER}/${RUST_ARCH}/rustup-init" -o rustup-init \ && chmod +x rustup-init \ && ./rustup-init -y --default-toolchain $rustc --profile minimal \ && rm rustup-init RUN ~/.cargo/bin/rustup target add x86_64-unknown-linux-musl RUN echo "[build]\ntarget = \"x86_64-unknown-linux-musl\"" > ~/.cargo/config RUN rustup component add rust-src --toolchain nightly-2024-02-01-x86_64-unknown-linux-gnu build: FROM +deps WORKDIR /source RUN cargo new locus WORKDIR /source/locus COPY amenadiel/ ./amenadiel/ COPY Cargo.* . RUN cargo build --release -Zbuild-std COPY .git .git COPY content content COPY src src COPY build.rs build.rs COPY yarte.toml yarte.toml RUN --mount=type=cache,target=/source/locus/target \ --mount=type=cache,target=/root/.cargo/registry \ cargo build --release --bin locus \ && strip -s /source/locus/target/x86_64-unknown-linux-musl/release/locus \ && mv /source/locus/target/x86_64-unknown-linux-musl/release/locus . SAVE ARTIFACT /source/locus/locus SAVE ARTIFACT /source/locus/content