-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.linux-armv7
70 lines (50 loc) · 2.16 KB
/
Dockerfile.linux-armv7
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
FROM rust:1.68.2 AS builder
LABEL org.opencontainers.image.description="SensorFu's Rust build container for armv7 musl"
LABEL org.opencontainers.image.source=https://github.com/sensorfu/rust-env
ENV TARGET="armv7-unknown-linux-musleabihf"
ARG LIBRESSL=libressl-3.6.2
ARG TOOLCHAIN_ARM7="armv7-eabihf--musl--stable-2020.02-2"
ARG TC_ARM7_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/${TOOLCHAIN_ARM7}.tar.bz2"
WORKDIR /opt
RUN curl -f -o- ${TC_ARM7_URL} | tar -xjf -
RUN ln -s /opt/${TOOLCHAIN_ARM7} /opt/arm7
ENV PATH="${PATH}:/opt/arm7/bin"
ENV CC_armv7_unknown_linux_musleabihf=arm-buildroot-linux-musleabihf-gcc
ENV CXX_armv7_unknown_linux_musleabihf=arm-buildroot-linux-musleabihf-g++
ENV LD_armv7_unknown_linux_musleabihf=arm-buildroot-linux-musleabihf-ld
WORKDIR /work
COPY sigs/* ./
RUN gpg --no-tty --import libressl.asc
RUN curl -fO https://cdn.openbsd.org/pub/OpenBSD/LibreSSL/${LIBRESSL}.tar.gz && \
gpg --no-tty --verify ${LIBRESSL}.tar.gz.asc ${LIBRESSL}.tar.gz && \
tar zxf ${LIBRESSL}.tar.gz && \
cd ${LIBRESSL} && \
CC=${CC_armv7_unknown_linux_musleabihf} \
CXX=${CXX_armv7_unknown_linux_musleabihf} \
LD=${LD_armv7_unknown_linux_musleabihf} \
./configure --prefix=/opt/libressl --host=armv7-linux-musleabihf --enable-shared=no --sysconfdir=/etc && \
make V=1 -j4 && \
make install
FROM rust:1.68.2-slim
ENV TARGET="armv7-unknown-linux-musleabihf"
RUN rustup target add ${TARGET}
COPY cargo.config "${CARGO_HOME}/config"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update && \
apt-get -y install \
bison \
clang \
file \
flex \
make \
protobuf-compiler \
&& \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt /opt
ENV PATH="${PATH}:/opt/arm7/bin"
ENV CC_armv7_unknown_linux_musleabihf=arm-buildroot-linux-musleabihf-gcc
ENV CXX_armv7_unknown_linux_musleabihf=arm-buildroot-linux-musleabihf-g++
ENV LD_armv7_unknown_linux_musleabihf=arm-buildroot-linux-musleabihf-ld
ENV ARMV7_UNKNOWN_LINUX_MUSLEABIHF_OPENSSL_LIB_DIR=/opt/libressl/lib
ENV ARMV7_UNKNOWN_LINUX_MUSLEABIHF_OPENSSL_INCLUDE_DIR=/opt/libressl/include
WORKDIR /