Skip to content

Commit

Permalink
meshtasticd-docker: Alpine container
Browse files Browse the repository at this point in the history
  • Loading branch information
vidplace7 committed Dec 24, 2024
1 parent b4b2fd6 commit e3fe5a8
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM python:3.12-alpine3.21 AS builder

ENV PIP_ROOT_USER_ACTION=ignore
RUN apk add bash g++ libstdc++-dev linux-headers zip git ca-certificates libgpiod-dev yaml-cpp-dev bluez-dev \
libusb-dev i2c-tools-dev openssl-dev pkgconf argp-standalone && \
pip install --no-cache-dir -U platformio==6.1.16 && \
mkdir /tmp/firmware

WORKDIR /tmp/firmware
COPY . /tmp/firmware

# For musl
ENV PLATFORMIO_BUILD_FLAGS="-largp"

RUN bash ./bin/build-native.sh && \
cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd"

# ##### PRODUCTION BUILD #############

FROM alpine:3.21

RUN apk add libstdc++ libgpiod yaml-cpp libusb i2c-tools gdb \
&& mkdir -p /var/lib/meshtasticd \
&& mkdir -p /etc/meshtasticd/config.d
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/sbin/

WORKDIR /var/lib/meshtasticd
VOLUME /var/lib/meshtasticd

EXPOSE 4403

CMD [ "sh", "-cx", "meshtasticd --fsdir=/var/lib/meshtasticd" ]

HEALTHCHECK NONE

0 comments on commit e3fe5a8

Please sign in to comment.