-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.node
41 lines (29 loc) · 1.31 KB
/
Dockerfile.node
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
FROM debian:bookworm-slim AS builder
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install build deps
USER root
RUN apt-get update && \
apt-get -y install wget python3 python3-pip python3-wheel python3-venv g++ zip git \
ca-certificates libgpiod-dev libyaml-cpp-dev libbluetooth-dev \
libulfius-dev liborcania-dev libssl-dev pkg-config
WORKDIR /tmp/firmware
RUN python3 -m venv /tmp/firmware
RUN source ./bin/activate && pip3 install -U platformio
COPY . /tmp/firmware
RUN source ./bin/activate && chmod +x /tmp/firmware/bin/build-native.sh && ./bin/build-native.sh
RUN cp /tmp/firmware/release/meshtasticd_linux_$(uname -m) /tmp/firmware/release/meshtasticd
##### PRODUCTION BUILD #############
FROM debian:bookworm-slim
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
RUN apt-get update && \
apt-get -y install libc-bin libc6 libgpiod2 libyaml-cpp0.7 libulfius2.7 liborcania2.3 libssl3
WORKDIR /home/mesh
COPY --from=builder /tmp/firmware/release/meshtasticd /home/mesh/
CMD sh -cx "./meshtasticd -d /home/mesh/data --hwid '${HWID:-$RANDOM}'"
HEALTHCHECK NONE