LedFxDocker
LedFxDocker copied to clipboard
Not most recent version of LedFx?
It seems like the docker container does not contain the current version of LedFx. It would be great if you could update it.
Thanks in advance.
Would be awesome to have the newest version, indeed, but it seems @ShiromMakkad hasn't been here in a while, which is unfortunate.
I tried running the update script but it failed. I won't have time to dig into it for a little bit.
I updated the Dockerfile a while ago, it worked at least for me like this:
FROM python:3.9-buster
WORKDIR /app
RUN pip install Cython
RUN dpkg --add-architecture armhf
RUN apt-get update
RUN apt-get install -y gcc \
git \
libatlas3-base \
libavformat58 \
portaudio19-dev \
avahi-daemon \
pulseaudio
RUN pip install --upgrade pip wheel setuptools
RUN pip install lastversion
RUN pip install numpy
ENV CFLAGS="-I/usr/local/lib/python3.9/site-packages/numpy/core/include $CFLAGS"
RUN pip install aubio
RUN pip install git+https://github.com/LedFx/LedFx
RUN apt-get install -y alsa-utils
RUN adduser root pulse-access
# https://gnanesh.me/avahi-docker-non-root.html
RUN apt-get install -y libnss-mdns
RUN echo '*' > /etc/mdns.allow \
&& sed -i "s/hosts:.*/hosts: files mdns4 dns/g" /etc/nsswitch.conf \
&& printf "[server]\nenable-dbus=no\n" >> /etc/avahi/avahi-daemon.conf \
&& chmod 777 /etc/avahi/avahi-daemon.conf \
&& mkdir -p /var/run/avahi-daemon \
&& chown avahi:avahi /var/run/avahi-daemon \
&& chmod 777 /var/run/avahi-daemon
RUN apt-get install -y wget \
libavahi-client3:armhf \
libavahi-common3:armhf \
apt-utils \
libvorbisidec1:armhf
RUN apt-get install -y squeezelite
ARG TARGETPLATFORM
RUN if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then ARCHITECTURE=armhf; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=armhf; else ARCHITECTURE=amd64; fi \
&& lastversion download badaix/snapcast --format assets --filter "^snapclient_(?:(\d+)\.)?(?:(\d+)\.)?(?:(\d+)\-)?(?:(\d)(_$ARCHITECTURE\.deb))$" -o snapclient.deb
RUN apt-get install -fy ./snapclient.deb
COPY setup-files/ /app/
RUN chmod a+wrx /app/*
ENTRYPOINT ./entrypoint.sh
I added these three lines:
RUN pip install numpy
ENV CFLAGS="-I/usr/local/lib/python3.9/site-packages/numpy/core/include $CFLAGS"
RUN pip install aubio
How'd you get that line for CFlags? I just checked and it's the aubio compilation that's failing. You shouldn't need to add the extra pip install for that or numpy because they should be dependencies. Honestly though, updating aubio separately so it makes a different layer in Docker may be worth it just because of how long it takes to compile.
Would be really awesome if we got an update. I really love this image but I'm not skilled enough to figure it out myself. It's alright if you don't have the time though.
Yea, I haven't had LEDs up for a while. Unfortunately, it's just low on my list right now. I do plan to put them up at some point and start developing on this repo, but for now I can't really respond to issues. There are a lot of really interesting issues with advice open that I do want to look at.
I would review a PR though. Updating LedFx should be a pretty gentle introduction to Docker. Most of the work was on the audio rather than building LedFx, but it takes an annoyingly long time to test because of the compilation times for ARM which I don't have right now.
Been fiddling around for a few weeks and managed to get it to build by changing the base image to a more recent version of python (python:3.10.14-bullseye), and installing cmake and numpy.
This dockerfile works for me...
FROM python:3.10.14-bullseye
WORKDIR /app
RUN pip install Cython
RUN dpkg --add-architecture armhf
RUN apt-get update
RUN apt-get install -y gcc \
git \
libatlas3-base \
libavformat58 \
portaudio19-dev \
avahi-daemon \
pulseaudio \
cmake
RUN pip install --upgrade pip wheel setuptools
RUN pip install lastversion
RUN pip install numpy
RUN pip install git+https://github.com/LedFx/LedFx
RUN apt-get install -y alsa-utils
RUN adduser root pulse-access
# https://gnanesh.me/avahi-docker-non-root.html
RUN apt-get install -y libnss-mdns
RUN echo '*' > /etc/mdns.allow \
&& sed -i "s/hosts:.*/hosts: files mdns4 dns/g" /etc/nsswitch.conf \
&& printf "[server]\nenable-dbus=no\n" >> /etc/avahi/avahi-daemon.conf \
&& chmod 777 /etc/avahi/avahi-daemon.conf \
&& mkdir -p /var/run/avahi-daemon \
&& chown avahi:avahi /var/run/avahi-daemon \
&& chmod 777 /var/run/avahi-daemon
RUN apt-get install -y wget \
libavahi-client3:armhf \
libavahi-common3:armhf \
apt-utils \
libvorbisidec1:armhf
RUN apt-get install -y squeezelite
ARG TARGETPLATFORM
RUN if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then ARCHITECTURE=armhf; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=armhf; else ARCHITECTURE=amd64; fi \
&& lastversion download badaix/snapcast --format assets --filter "^snapclient_(?:(\d+)\.)?(?:(\d+)\.)?(?:(\d+)\-)?(?:(\d)(_$ARCHITECTURE\.deb))$" -o snapclient.deb
RUN apt-get install -fy ./snapclient.deb
COPY setup-files/ /app/
RUN chmod a+wrx /app/*
ENTRYPOINT ./entrypoint.sh