-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.armhf
42 lines (32 loc) · 1.67 KB
/
Dockerfile.armhf
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
FROM debian:bookworm AS builder
WORKDIR /app
COPY ./ ./
RUN dpkg --add-architecture armhf
RUN apt update
RUN apt upgrade -y
RUN apt install -y build-essential curl libssl-dev clang libclang-dev pkg-config sqlite3 \
crossbuild-essential-armhf libopencv-dev:armhf libssl-dev:armhf libleptonica-dev:armhf libtesseract-dev:armhf
ENV PKG_CONFIG_PATH /usr/lib/arm-linux-gnueabihf/pkgconfig/
ENV PKG_CONFIG_ALLOW_CROSS 1
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup target add armv7-unknown-linux-gnueabihf
RUN mkdir /.cargo && \
echo '[target.armv7-unknown-linux-gnueabihf]\nlinker = "arm-linux-gnueabihf-gcc"' >> /.cargo/config
ENV DATABASE_URL=sqlite:token.db
RUN sqlite3 token.db < migrations/20210525000135_table.sql
RUN mkdir -p /app/bin
RUN cargo build --release --target armv7-unknown-linux-gnueabihf -p lofigirl_client --features standalone
RUN mv ./target/armv7-unknown-linux-gnueabihf/release/lofigirl_client /app/bin/lofigirl_client_standalone
RUN cargo build --release --target armv7-unknown-linux-gnueabihf -p lofigirl_client -p lofigirl_server
RUN mv ./target/armv7-unknown-linux-gnueabihf/release/lofigirl_client /app/bin/
RUN mv ./target/armv7-unknown-linux-gnueabihf/release/lofigirl_server /app/bin/
FROM debian:bookworm as runner
COPY --from=builder /app/bin/lofigirl_client /usr/bin/
COPY --from=builder /app/bin/lofigirl_server /usr/bin/
COPY --from=builder /app/bin/lofigirl_client_standalone /usr/bin/
RUN dpkg --add-architecture armhf
RUN apt update
RUN apt upgrade -y
RUN apt install -y libopencv-dev:armhf libleptonica-dev:armhf libtesseract-dev:armhf tesseract-ocr-eng
ENTRYPOINT [ "lofigirl_server" ]