-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
7 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 |
---|---|---|
@@ -1,2 +1 @@ | ||
/conf | ||
/target |
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 |
---|---|---|
@@ -1,11 +1,20 @@ | ||
FROM docker.io/python:3.11-slim-bookworm | ||
FROM ubuntu:noble | ||
|
||
RUN apt update && apt install -y cargo libudev-dev pkg-config | ||
COPY conf/sources.list /etc/apt/sources.list | ||
RUN apt update | ||
RUN dpkg --add-architecture armhf | ||
|
||
ENV VIRTUAL_ENV=/opt/venv | ||
RUN python3 -m venv $VIRTUAL_ENV | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
RUN apt install -y gcc-arm-linux-gnueabihf rustup build-essential | ||
RUN apt install -y pkg-config python3 python3-pip python3-venv protobuf-compiler | ||
RUN apt install -y libudev-dev:armhf | ||
|
||
RUN rustup default stable && rustup target add armv7-unknown-linux-gnueabihf | ||
|
||
WORKDIR /app | ||
COPY . . | ||
RUN pip install maturin && maturin develop | ||
|
||
ENV PKG_CONFIG_ALLOW_CROSS=1 | ||
ENV PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig | ||
ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc | ||
ENV PYO3_CROSS_PYTHON_VERSION=3.12 | ||
RUN cargo build --release --target armv7-unknown-linux-gnueabihf |