Public Repository

Last pushed: 2 years ago
Short Description
Node-RED image build on top of armhfbuild/debian
Full Description

Node-RED image for ARM platforms (i.e. banana pi)

Built on top of https://hub.docker.com/r/armhfbuild/debian/

I execute it as follows:

docker run -d --name node-red -h `hostname` -v /home/madeddie/node-red:/root/.node-red -p 1880:1880 --device /dev/ttyUSB0 --device /dev/ttyUSB1 madtech/node-red-armhf:latest
  • Using -h hostname makes that the flow files have the same name (that of this host)
  • /home/madeddie/node-red contains my node-red config and flows
  • /dev/ttyUSB0 and /dev/ttyUSB1 are my RFXcom and Zwave devices, they're unneeded if you don't use them

Uses Europe/Amsterdam timezone.

Has the following plugins:

  • node-red-contrib-influxdb
  • node-red-contrib-mqttssl
  • node-red-contrib-rfxcom
  • node-red-node-google
  • node-red-node-nma
  • node-red-node-suncalc
  • node-red-node-weather-underground
  • node-red-contrib-openzwave

Dockerfile

FROM armhfbuild/debian:jessie
MAINTAINER edwin@madtech.cx

ARG NR_VERSION
ENV INSTALL_ZWAVE true
ENV NODE_DISTRO_URL https://deb.nodesource.com/setup_4.x
ENV TZ Europe/Amsterdam

# Add node.js repo and install node.js and other needed packages
RUN wget --no-check-certificate -O - $NODE_DISTRO_URL | bash - \
  && apt-get install -y --no-install-recommends \
    build-essential \
    curl \
    git \
    nodejs \
    python-dev \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/*

# Install node-red
RUN npm install -g --unsafe-perm \
    node-red@${NR_VERSION} \
  && npm cache clean

# Install node-red nodes
# Current version of mqttssl in npm is lacking features
RUN npm install -g --unsafe-perm \
    node-red-contrib-influxdb \
    git://github.com/madeddie/node-red-contrib-mqttssl.git \
    node-red-contrib-rfxcom \
    node-red-node-google \
    node-red-node-nma \
    node-red-node-suncalc \
    node-red-node-weather-underground \
    json-db-node-red \
  && npm cache clean

# Compile and install openzwave lib
RUN if [ x"$INSTALL_ZWAVE" = x"true" ]; then \
    apt-get update && apt-get install -y \
    libudev-dev \
    pkg-config \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/* \
  && curl -RLo /openzwave.tar.gz http://old.openzwave.com/downloads/openzwave-1.2.919.tar.gz \
  && mkdir /openzwave \
  && tar xvzf /openzwave.tar.gz --strip-components=1 -C /openzwave \
  && cd /openzwave && make && make install && cd .. \
  && rm -rf /openzwave /openzwave.tar.gz \
  ;fi

# Install openzwave node-red nodes + lib
RUN if [ x"$INSTALL_ZWAVE" = x"true" ]; then \
    npm install -g --unsafe-perm \
    openzwave-shared \
    node-red-contrib-openzwave \
  && npm cache clean \
  ;fi

# set timezone
RUN echo "$TZ" > /etc/timezone \
  && dpkg-reconfigure -f noninteractive tzdata

# needed so libopenzwave can be found
RUN ldconfig

EXPOSE 1880

CMD ["node-red-pi", "--max-old-space-size=128"]
Docker Pull Command
Owner
madtech