-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dockerfile to xc for raspberry pi
- Loading branch information
1 parent
a989e8f
commit 129a531
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM debian:bullseye | ||
|
||
RUN apt update && apt install --no-install-recommends -y libssl-dev pkg-config libasound2-dev gcc-aarch64-linux-gnu curl ca-certificates libc6-dev-arm64-cross | ||
|
||
WORKDIR /workdir | ||
|
||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -t 'aarch64-unknown-linux-gnu' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker build -t "rpi-xc-bullseye-aarch64" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
set -x | ||
|
||
TARGET_TRIPLE="aarch64-unknown-linux-gnu" | ||
IMAGE_NAME="rpi-xc-bullseye-aarch64" | ||
|
||
CARGO_ARGS="build --bin refbox --target $TARGET_TRIPLE --release" | ||
CONTAINER_WORKDIR="/workdir/uwh-refbox-rs" | ||
|
||
CONTAINER_NAME="$(docker create -t -w "$CONTAINER_WORKDIR/" $IMAGE_NAME /root/.cargo/bin/cargo $CARGO_ARGS)" | ||
|
||
BASE_DIR="$(dirname "$0")/../.." | ||
|
||
for file in $(ls "$BASE_DIR" | grep -v target | grep -v xc); do | ||
docker cp "$BASE_DIR/$file" "$CONTAINER_NAME:$CONTAINER_WORKDIR/" | ||
done | ||
|
||
docker start -a "$CONTAINER_NAME" | ||
|
||
docker cp "$CONTAINER_NAME:$CONTAINER_WORKDIR/target/release/refbox" "$(dirname "$0")/output/$TARGET_TRIPLE/" | ||
docker cp "$CONTAINER_NAME:$CONTAINER_WORKDIR/target/$TARGET_TRIPLE/release/refbox" "$(dirname "$0")/output/" | ||
|
||
docker rm "$CONTAINER_NAME" |