aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-05-21 10:07:37 +0000
committerFuwn <[email protected]>2025-05-21 10:07:37 +0000
commitf69afe04b1e0a8b954d53249f7d5f1b8c28e8eb4 (patch)
tree66cbc778dfa176f680d03ceeebe6e54b69c4709e
parentfix(html): Escape nested list items in headings (diff)
downloadseptember-f69afe04b1e0a8b954d53249f7d5f1b8c28e8eb4.tar.xz
september-f69afe04b1e0a8b954d53249f7d5f1b8c28e8eb4.zip
build(container): Simplify build task
-rw-r--r--Earthfile35
1 files changed, 6 insertions, 29 deletions
diff --git a/Earthfile b/Earthfile
index c33ea16..fc13776 100644
--- a/Earthfile
+++ b/Earthfile
@@ -1,9 +1,6 @@
VERSION 0.7
-all:
- BUILD +docker
-
-docker:
+image:
ARG tag=latest
FROM scratch
@@ -16,25 +13,8 @@ docker:
SAVE IMAGE --push fuwn/september:$tag
-deps:
- ARG rustc="1.78.0"
-
- FROM clux/muslrust:$rustc-stable
-
- 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 \
- && ~/.cargo/bin/rustup target add x86_64-unknown-linux-musl \
- && echo "[build]\ntarget = \"x86_64-unknown-linux-musl\"" > ~/.cargo/config
-
- RUN apt-get update && apt-get install -y gnupg2
-
- RUN curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
- && apt-get install -y clang
-
build:
- FROM +deps
+ FROM messense/rust-musl-cross:x86_64-musl
WORKDIR /source
@@ -44,7 +24,7 @@ build:
COPY Cargo.* .
- RUN cargo build --release
+ RUN --mount=type=cache,target=/usr/local/cargo/registry cargo build --release
COPY .git .git
COPY src src
@@ -52,11 +32,8 @@ build:
COPY Cargo.* .
COPY default.css .
- RUN --mount=type=cache,target=/source/september/target \
- --mount=type=cache,target=/root/.cargo/registry \
- cargo build --release --bin september \
- && strip -s /source/september/target/x86_64-unknown-linux-musl/release/september \
- && mv /source/september/target/x86_64-unknown-linux-musl/release/september .
+ RUN --mount=type=cache,target=/usr/local/cargo/registry cargo build --release
+ RUN strip -s /source/september/target/x86_64-unknown-linux-musl/release/september
+ RUN mv /source/september/target/x86_64-unknown-linux-musl/release/september .
SAVE ARTIFACT /source/september/september
-