-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathcompose.yml
More file actions
executable file
·76 lines (71 loc) · 2.3 KB
/
Copy pathcompose.yml
File metadata and controls
executable file
·76 lines (71 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
services:
build:
build: .
image: orchestrator:latest
# Build the Linux x64 release binary when Cargo is unavailable on the host.
# Usage: docker compose run --rm dev
dev:
image: rust:1.98.1-bookworm
platform: linux/amd64
working_dir: /app
volumes:
- .:/app
- cargo-cache:/usr/local/cargo/registry
- target-cache:/app/target
command: >
sh -c "
rustup target add x86_64-unknown-linux-gnu &&
cargo build --release --target x86_64-unknown-linux-gnu &&
mkdir -p bin &&
cp target/x86_64-unknown-linux-gnu/release/orchestrator bin/orchestrator-linux-x64 &&
echo 'Rust build complete: bin/orchestrator-linux-x64'
"
# Build the Linux arm64 release binary.
# Usage: docker compose run --rm rust-arm64
rust-arm64:
image: rust:1.98.1-bookworm
platform: linux/amd64
working_dir: /app
volumes:
- .:/app
- cargo-cache:/usr/local/cargo/registry
- target-cache:/app/target
command: >
sh -c "
rustup target add aarch64-unknown-linux-gnu &&
apt-get update -q && apt-get install -y -q gcc-aarch64-linux-gnu &&
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc &&
cargo build --release --target aarch64-unknown-linux-gnu &&
mkdir -p bin &&
cp target/aarch64-unknown-linux-gnu/release/orchestrator bin/orchestrator-linux-arm64 &&
echo 'arm64 build complete: bin/orchestrator-linux-arm64'
"
# Cross-compile the Windows release binary.
# Usage: docker compose run --rm win-builder
win-builder:
build:
context: .
dockerfile: Dockerfile.windows
volumes:
- .:/app
- cargo-cache:/usr/local/cargo/registry
- target-cache:/app/target
command: >
sh -c "
cargo build --release --target x86_64-pc-windows-gnu &&
mkdir -p bin &&
cp target/x86_64-pc-windows-gnu/release/orchestrator.exe bin/orchestrator-windows-x64.exe &&
echo 'Windows build complete: bin/orchestrator-windows-x64.exe'
"
# Run Rust unit tests.
test:
image: rust:1.98.1-bookworm
working_dir: /app
volumes:
- .:/app
- cargo-cache:/usr/local/cargo/registry
- target-cache:/app/target
command: cargo test
volumes:
cargo-cache:
target-cache: