-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.gnueabihf
33 lines (26 loc) · 964 Bytes
/
Dockerfile.gnueabihf
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
FROM ubuntu:18.04 as build
COPY etc/sources.list.armhf /etc/apt/sources.list
COPY etc/cargo-config.toml /root/.cargo/config
RUN dpkg --add-architecture armhf && \
apt-get update -y && \
apt-get install -y --no-install-recommends \
curl git \
pkg-config make cmake file ca-certificates g++ \
gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
libc6-dev-armhf-cross binutils-arm-linux-gnueabihf \
libudev-dev libudev-dev:armhf
ENV PATH=/root/.cargo/bin:$PATH \
RUST_TARGETS="arm-unknown-linux-gnueabihf" \
PKG_CONFIG_ALLOW_CROSS=1 \
PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig \
RUST_BACKTRACE=1
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
rustup target add arm-unknown-linux-gnueabihf
COPY Cargo.lock Cargo.toml /project/
COPY src /project/src
WORKDIR /project
RUN cargo build \
--release \
--target=arm-unknown-linux-gnueabihf \
--bins \
--all-features