Skip to content

Commit c22d182

Browse files
committed
refactor: use proper Docker build outputs
1 parent 1eb1e87 commit c22d182

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

Software/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,12 @@ COPY . .
3131

3232
# Build for Raspberry Pi (no-default-features to skip druid/GUI)
3333
RUN cargo build --release --target aarch64-unknown-linux-gnu --no-default-features --features real
34+
RUN aarch64-linux-gnu-strip /app/target/aarch64-unknown-linux-gnu/release/phone-bell-software
3435

3536
# The binary will be at /app/target/aarch64-unknown-linux-gnu/release/phone-bell-software
37+
38+
FROM scratch
39+
COPY --from=builder /app/target/aarch64-unknown-linux-gnu/release/phone-bell-software /phone-bell-software-arm64
40+
ENTRYPOINT ["/phone-bell-software-arm64"]
41+
42+
# The binary will be at /phone-bell-software-arm64 in the output image

Software/build-rpi.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ set -e
44
cd "$(dirname "$0")"
55

66
echo "Building Docker image..."
7-
docker build -t phone-bell-builder .
8-
9-
echo "Extracting binary..."
10-
docker create --name phone-bell-temp phone-bell-builder
11-
docker cp phone-bell-temp:/app/target/aarch64-unknown-linux-gnu/release/phone-bell-software ./phone-bell-software-arm64
12-
docker rm phone-bell-temp
13-
14-
echo "Stripping debug symbols..."
15-
docker run --rm -v "$(pwd):/out" phone-bell-builder \
16-
aarch64-linux-gnu-strip -o /out/phone-bell-software-arm64 /out/phone-bell-software-arm64
17-
7+
docker build -o . .
188
echo "Done! Binary: phone-bell-software-arm64"
199
ls -lh phone-bell-software-arm64

0 commit comments

Comments
 (0)