init: SNEK on Kubernetes
- Dockerfile: Ubuntu 20.04 + all SNEK dependencies (libgtk2-perl, libffi6, etc.) - entrypoint.sh: flash firmware via foxctl, start main_sigfox - deploy/snek.yaml: K8s manifest (namespace, PVC, deployment, LoadBalancer) - README: full documentation covering hardware, software, decoding, callbacks
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
FROM ubuntu:20.04
|
||||
|
||||
LABEL org.opencontainers.image.title="Sigfox Network Emulator (SNEK)"
|
||||
LABEL org.opencontainers.image.description="SNEK 2.3.4 pre-installed with all dependencies for Sigfox SDR dongle"
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG SNEK_URL=https://support.sigfox.com/files/5e6202fa7d734d7f7f84a08e
|
||||
|
||||
# System dependencies (GTK stack + SNEK runtime deps)
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
wget \
|
||||
ca-certificates \
|
||||
usbutils \
|
||||
libgtk2-perl \
|
||||
zenity \
|
||||
python \
|
||||
libdbus-glib-1-2 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# libffi6 is not in Ubuntu 20.04 by default (SNEK is built against Ubuntu 18.04 ABI)
|
||||
RUN cd /tmp && \
|
||||
wget -q http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb && \
|
||||
dpkg -i libffi6_3.2.1-8_amd64.deb && \
|
||||
rm libffi6_3.2.1-8_amd64.deb
|
||||
|
||||
# Download and install SNEK
|
||||
RUN curl -Ls "${SNEK_URL}" -o /tmp/snek.deb && \
|
||||
dpkg -i /tmp/snek.deb || apt-get install -f -y && \
|
||||
rm /tmp/snek.deb && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Entrypoint: flash firmware then start SNEK server
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENV LD_LIBRARY_PATH=/opt/snek
|
||||
ENV GI_TYPELIB_PATH=/opt/snek
|
||||
|
||||
WORKDIR /opt/snek
|
||||
|
||||
EXPOSE 8085
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "==> Sigfox Network Emulator container starting"
|
||||
echo "==> Detecting Sigfox dongle..."
|
||||
|
||||
if lsusb | grep -iE "2cc1"; then
|
||||
echo "==> Dongle detected"
|
||||
else
|
||||
echo "!!! WARNING: no Sigfox dongle detected on /dev/bus/usb"
|
||||
echo "!!! Make sure the container has: privileged: true AND /dev/bus/usb mounted"
|
||||
fi
|
||||
|
||||
echo "==> Flashing firmware (foxctl)..."
|
||||
cd /opt/snek
|
||||
./foxctl || echo "foxctl RC=$? (may be normal if firmware already loaded)"
|
||||
sleep 2
|
||||
|
||||
echo "==> Starting SNEK main_sigfox on port 8085..."
|
||||
exec ./main_sigfox
|
||||
Reference in New Issue
Block a user