forked from earthly/earthly
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEarthfile
More file actions
22 lines (19 loc) · 745 Bytes
/
Earthfile
File metadata and controls
22 lines (19 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
VERSION 0.8
IMPORT github.com/earthly/lib/rust:3.0.1 AS rust
FROM rust:slim-bookworm
WORKDIR /rustexample
# build creates the binary target/release/example-rust
build:
# CARGO function adds caching to cargo runs.
# See https://github.com/earthly/lib/tree/main/rust
DO rust+INIT --keep_fingerprints=true
COPY --keep-ts --dir src Cargo.lock Cargo.toml .
DO rust+CARGO --args="build --release --bin example-rust" --output="release/[^/\.]+"
SAVE ARTIFACT target/release/example-rust example-rust
# docker creates docker image earthly/examples:rust
docker:
FROM debian:bookworm-slim
COPY +build/example-rust example-rust
EXPOSE 9091
ENTRYPOINT ["./example-rust"]
SAVE IMAGE --push earthly/examples:rust