From 8b1e55ca633fcf3c2d9fa2617bbdbbb5478f2ea6 Mon Sep 17 00:00:00 2001 From: Joep Meindertsma Date: Thu, 7 Dec 2023 15:32:23 +0100 Subject: [PATCH] Improved docker rust cache --- Earthfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Earthfile b/Earthfile index fb00c07ca..f1cc358a4 100644 --- a/Earthfile +++ b/Earthfile @@ -1,7 +1,8 @@ VERSION --try --global-cache 0.7 PROJECT ontola/atomic-server IMPORT ./browser AS browser -IMPORT github.com/earthly/lib/rust:2.2.11 AS rust +# IMPORT github.com/earthly/lib/rust:2.2.11 AS rust +IMPORT github.com/earthly/lib/rust:nacho/with_docker AS rust FROM rust:1.73.0-buster WORKDIR /code @@ -45,10 +46,8 @@ source: cross-build: FROM +source ARG --required TARGET - # This does not yet cache properly - # https://github.com/earthly/lib/issues/34 WITH DOCKER - RUN cross build --target $TARGET --release + DO rust+CARGO --args="cross" --$with_docker="--load ghcr.io/cross-rs/$TARGET:v0.2.5" END SAVE ARTIFACT ./target/$TARGET/release/atomic-server AS LOCAL artifact/bin/atomic-server-$TARGET