Compare commits

..

77 Commits

Author SHA1 Message Date
Joshua Schnabel (Atlantis) de72d9bf46 Umzug 2021-03-14 01:04:58 +01:00
Joshua Schnabel 6e61f2ed05 Update Dockerfile 2020-11-07 19:59:10 +01:00
Joshua Schnabel 357ac2d424 Update Dockerfile 2020-10-18 23:14:04 +02:00
Joshua Schnabel 572313bedc Update Dockerfile 2020-10-18 22:54:03 +02:00
Joshua Schnabel b40f031713 Update Dockerfile 2020-10-18 21:24:31 +02:00
Joshua Schnabel 08892b889c Update Dockerfile 2020-09-27 18:06:44 +02:00
Joshua Schnabel d335dd2b2c Update Dockerfile 2020-09-27 17:58:01 +02:00
Joshua Schnabel 131dc5c94f Update Dockerfile 2020-09-27 17:51:12 +02:00
Joshua Schnabel 6c34273917 Update Dockerfile 2020-09-27 17:50:28 +02:00
Joshua Schnabel aae5a27325 Update Dockerfile 2020-09-27 17:46:16 +02:00
Joshua Schnabel 6bf3b62cde Update Dockerfile 2020-09-27 17:45:11 +02:00
Joshua Schnabel 3323900e8b Update Dockerfile 2020-09-27 17:17:09 +02:00
Joshua Schnabel (Atlantis) 8e9c4db006 new image 2020-09-20 19:22:58 +02:00
Joshua Schnabel 2b7558f1e0 Update Dockerfile 2020-09-19 15:04:49 +02:00
Joshua Schnabel 9201c088d6 Update Dockerfile 2020-09-19 15:02:01 +02:00
Joshua Schnabel 2371a2d8cf Update Dockerfile 2020-09-19 15:00:20 +02:00
Joshua Schnabel 752fc137b7 Update Dockerfile 2020-09-19 14:57:37 +02:00
Joshua Schnabel bc907bcb26 Update Dockerfile 2020-09-19 14:56:48 +02:00
Joshua Schnabel de8d63937b Update Dockerfile 2020-09-19 14:55:31 +02:00
Joshua Schnabel bf66b448d7 Update Dockerfile 2020-09-19 14:55:02 +02:00
Joshua Schnabel a563018933 Create Dockerfile 2020-09-19 14:53:52 +02:00
Joshua Schnabel (Atlantis) b3d15f0016 Fix image 2020-09-19 00:49:08 +02:00
Joshua Schnabel (Atlantis) 2611149ae3 New nodered 2020-09-19 00:28:22 +02:00
Joshua Schnabel 5aa7741027 Update Dockerfile 2020-09-19 00:08:54 +02:00
Joshua Schnabel 6fd3c900d8 Update Dockerfile 2020-09-19 00:05:47 +02:00
Joshua Schnabel 43d295a847 Update Dockerfile 2020-09-18 23:55:04 +02:00
Joshua Schnabel 9f30f46620 Update Dockerfile 2020-09-18 23:17:40 +02:00
Joshua Schnabel b2e5bae5e5 Update Dockerfile 2020-05-19 11:57:16 +02:00
Joshua Schnabel 432c41f3ff Update Dockerfile 2020-05-19 10:07:06 +02:00
Joshua Schnabel 14c6e5778a Update Dockerfile 2020-05-19 09:48:10 +02:00
Joshua Schnabel 1cf0cd721a Update Dockerfile 2020-05-19 09:45:36 +02:00
Joshua Schnabel f2c213f61b Create Dockerfile 2020-05-19 09:29:16 +02:00
Joshua Schnabel 7f2d596dc5 Update Dockerfile 2020-04-29 14:12:27 +02:00
Joshua Schnabel 6e22ef451f Update Dockerfile 2020-04-29 09:45:33 +02:00
Joshua Schnabel 212b8fee42 Update Dockerfile 2020-04-29 09:42:27 +02:00
Joshua Schnabel 4252320bd9 Update Dockerfile 2020-04-29 01:23:51 +02:00
Joshua Schnabel c2a8c35d1c Update Dockerfile 2020-04-29 01:04:53 +02:00
Joshua Schnabel 78da453887 Update Dockerfile 2020-04-29 00:40:02 +02:00
Joshua Schnabel 009eb35a66 Update Dockerfile 2020-04-29 00:38:38 +02:00
Joshua Schnabel 398170b69b Update Dockerfile 2020-04-29 00:35:05 +02:00
Joshua Schnabel ae363d6fad Update Dockerfile 2020-04-29 00:33:00 +02:00
Joshua Schnabel 7c9cbd6f8b Update Dockerfile 2020-04-29 00:21:23 +02:00
Joshua Schnabel a1f5a20bbc Update Dockerfile 2020-04-29 00:20:24 +02:00
Joshua Schnabel 919d7e1eff Update Dockerfile 2020-04-29 00:19:52 +02:00
Joshua Schnabel a99e783825 Update Dockerfile 2020-04-29 00:18:15 +02:00
Joshua Schnabel 7c6fa45118 Update install_devtools.sh 2020-04-28 23:58:47 +02:00
Joshua Schnabel 4477e2b9d8 Update install_devtools.sh 2020-04-28 23:54:34 +02:00
Joshua Schnabel 83a33af7c6 Update install_devtools.sh 2020-04-28 23:51:51 +02:00
Joshua Schnabel 9b0bd5e38c Update Dockerfile 2020-04-28 23:47:35 +02:00
Joshua Schnabel 7dcde9819a Update Dockerfile 2020-04-28 23:43:59 +02:00
Joshua Schnabel 6da2604ab2 Update Dockerfile 2020-04-28 23:34:26 +02:00
Joshua Schnabel ed72a42e28 Update Dockerfile 2020-04-28 23:30:40 +02:00
Joshua Schnabel 00bd370bfc Create package.json 2020-04-28 23:24:34 +02:00
Joshua Schnabel aaa2a33bf3 Update Dockerfile 2020-04-28 22:56:35 +02:00
Joshua Schnabel 7ed184c8e9 Update Dockerfile 2020-04-28 22:55:30 +02:00
Joshua Schnabel b3090f95a6 Update Dockerfile 2020-04-28 22:52:35 +02:00
Joshua Schnabel a190f0fc74 Update Dockerfile 2020-04-28 22:33:17 +02:00
Joshua Schnabel 4499ecfd9e Update Dockerfile 2020-04-28 22:25:52 +02:00
Joshua Schnabel 470ed7d115 Update Dockerfile 2020-04-28 22:14:52 +02:00
Joshua Schnabel a85c756a58 Update Dockerfile 2020-04-28 22:13:57 +02:00
Joshua Schnabel 57667dbc05 Update Dockerfile 2020-04-28 22:09:22 +02:00
Joshua Schnabel 6f0c31d338 Update install_devtools.sh 2020-04-28 22:06:45 +02:00
Joshua Schnabel 02813294bb Update Dockerfile 2020-04-28 22:05:53 +02:00
Joshua Schnabel 17982954fd Create remove_native_gpio.sh 2020-04-28 21:46:19 +02:00
Joshua Schnabel b5d174a18d Create install_devtools.sh 2020-04-28 21:45:49 +02:00
Joshua Schnabel 56a676d075 Update Dockerfile 2020-04-28 21:43:53 +02:00
Joshua Schnabel 91014fa53f Update nginx.conf 2020-04-24 16:52:52 +02:00
Joshua Schnabel 1a5b692b88 Update nginx.conf 2020-04-24 16:46:54 +02:00
Joshua Schnabel 3ed686189e Update nginx.conf 2020-04-23 18:42:10 +02:00
Joshua Schnabel 4d75f8cd2b Update Dockerfile 2020-04-23 18:41:36 +02:00
Joshua Schnabel d39c6b23e4 Update nginx.conf 2020-04-23 18:26:08 +02:00
Joshua Schnabel 58e5016326 Create nginx.conf 2020-04-23 18:19:50 +02:00
Joshua Schnabel 8bab2584f1 Update Dockerfile 2020-04-23 18:19:25 +02:00
Joshua Schnabel e4dc297c0a Create Dockerfile 2020-04-23 18:05:06 +02:00
Joshua Schnabel b4ff71b790 Delete test.txt 2020-04-20 16:30:30 +02:00
Joshua Schnabel (Atlantis) c9d801b466 Test 2020-04-20 16:28:23 +02:00
joshua 6c300e18a5 Init 2020-04-20 16:15:22 +02:00
16 changed files with 489 additions and 21 deletions
-19
View File
@@ -1,19 +0,0 @@
MIT License Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-2
View File
@@ -1,2 +0,0 @@
# docker-images
+51
View File
@@ -0,0 +1,51 @@
FROM alpine:3.11 AS builder
ARG DNSDIST_VERSION
RUN apk --update upgrade && \
apk add ca-certificates curl jq && \
apk add --virtual .build-depends \
file gnupg g++ make \
boost-dev openssl-dev libsodium-dev lua-dev net-snmp-dev protobuf-dev \
libedit-dev re2-dev h2o-dev wslay-dev && \
[ -n "$DNSDIST_VERSION" ] || { curl -sSL 'https://api.github.com/repos/PowerDNS/pdns/tags?per_page=100&page={1,2}' | jq -rs '[.[][]]|map(select(has("name")))|map(select(.name|contains("dnsdist-")))|map(.version=(.name|ltrimstr("dnsdist-")))|map(select(true != (.version|contains("-"))))|map(.version)|"DNSDIST_VERSION="+.[0]' > /tmp/latest-dnsdist-tag.sh && . /tmp/latest-dnsdist-tag.sh; } && \
mkdir -v -m 0700 -p /root/.gnupg && \
curl -RL -O 'https://dnsdist.org/_static/dnsdist-keyblock.asc' && \
gpg2 --no-options --verbose --keyid-format 0xlong --keyserver-options auto-key-retrieve=true \
--import *.asc && \
curl -RL -O "https://downloads.powerdns.com/releases/dnsdist-${DNSDIST_VERSION}.tar.bz2{.asc,.sig,}" && \
gpg2 --no-options --verbose --keyid-format 0xlong --keyserver-options auto-key-retrieve=true \
--verify *.sig && \
rm -rf /root/.gnupg *.asc *.sig && \
tar -xpf "dnsdist-${DNSDIST_VERSION}.tar.bz2" && \
rm -f "dnsdist-${DNSDIST_VERSION}.tar.bz2" && \
( \
cd "dnsdist-${DNSDIST_VERSION}" && \
./configure --sysconfdir=/etc/dnsdist --mandir=/usr/share/man \
--enable-dnscrypt --enable-dns-over-tls --enable-dns-over-https --with-libsodium --with-re2 --with-net-snmp && \
make -j 2 && \
make install-strip \
) && \
apk del --purge .build-depends && rm -rf /var/cache/apk/*
FROM alpine:3.11
LABEL maintainer="https://keybase.io/tcely"
RUN apk --update upgrade && \
apk add ca-certificates curl less man \
openssl libsodium lua net-snmp protobuf \
libedit re2 && \
rm -rf /var/cache/apk/*
ENV PAGER less
RUN addgroup -S dnsdist && \
adduser -S -D -G dnsdist dnsdist
COPY --from=builder /usr/local/bin /usr/local/bin/
COPY --from=builder /usr/share/man/man1 /usr/share/man/man1/
RUN /usr/local/bin/dnsdist --version
ENTRYPOINT ["/usr/local/bin/dnsdist"]
CMD ["--help"]
+9
View File
@@ -0,0 +1,9 @@
FROM alpine
MAINTAINER Jaka Hudoklin <offlinehacker@users.noreply.github.com>
RUN apk add --no-cache bash hostapd iptables dhcp docker iproute2 iw
RUN echo "" > /var/lib/dhcp/dhcpd.leases
ADD wlanstart.sh /bin/wlanstart.sh
ENTRYPOINT [ "/bin/wlanstart.sh" ]
+82
View File
@@ -0,0 +1,82 @@
# Docker container stack: hostap + dhcp server
This container starts wireless access point (hostap) and dhcp server in docker
container. It supports both host networking and network interface reattaching
to container network namespace modes (host and guest).
## Requirements
On the host system install required wifi drivers, then make sure your wifi adapter
supports AP mode:
```
# iw list
...
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* WDS
* monitor
* mesh point
...
```
Set country regulations, for example, for Spain set:
```
# iw reg set ES
country ES: DFS-ETSI
(2400 - 2483 @ 40), (N/A, 20), (N/A)
(5150 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR
(5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS
(5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
(57000 - 66000 @ 2160), (N/A, 40), (N/A)
```
## Build / run
* Using host networking:
```
sudo docker run -i -t -e INTERFACE=wlan1 -e OUTGOINGS=wlan0 --net host --privileged won10/hostapd
```
* Using network interface reattaching:
```
sudo docker run -d -t -e INTERFACE=wlan0 -v /var/run/docker.sock:/var/run/docker.sock --privileged offlinehacker/docker-ap
```
This mode requires access to docker socket, so it can run a short lived
container that reattaches network interface to network namespace of this
container. It also renames wifi interface to **wlan0**, so you get
deterministic networking environment. This mode can be usefull for example for
pentesting, where can you use docker compose to run other wifi hacking tools
and have deterministic environment with wifi interface.
## Environment variables
* **INTERFACE**: name of the interface to use for wifi access point (default: wlan0)
* **OUTGOINGS**: outgoing network interface (default: eth0)
* **CHANNEL**: WIFI channel (default: 6)
* **SUBNET**: Network subnet (default: 192.168.254.0)
* **AP_ADDR**: Access point address (default: 192.168.254.1)
* **SSID**: Access point SSID (default: docker-ap)
* **WPA_PASSPHRASE**: WPA password (default: passw0rd)
* **HW_MODE**: WIFI mode to use (default: g)
* **DRIVER**: WIFI driver to use (default: nl80211)
* **HT_CAPAB**: WIFI HT capabilities for 802.11n (default: [HT40-][SHORT-GI-20][SHORT-GI-40])
* **MODE**: Mode to run in guest/host (default: host)
## License
MIT
## Author
Jaka Hudoklin <jakahudoklin@gmail.com>
Thanks to https://github.com/sdelrio/rpi-hostap for providing original
implementation.
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
docker run -i -t -e INTERFACE=wlan0 -e OUTGOINGS=eth0 --net host --privileged won10/hostapd
+126
View File
@@ -0,0 +1,126 @@
#!/bin/bash -e
# Check if running in privileged mode
if [ ! -w "/sys" ] ; then
echo "[Error] Not running in privileged mode."
exit 1
fi
# Default values
true ${INTERFACE:=wlan0}
true ${SUBNET:=192.168.254.0}
true ${AP_ADDR:=192.168.254.1}
true ${SSID:=docker-ap}
true ${CHANNEL:=11}
true ${WPA_PASSPHRASE:=passw0rd}
true ${HW_MODE:=g}
true ${DRIVER:=nl80211}
true ${HT_CAPAB:=[HT40-][SHORT-GI-20][SHORT-GI-40]}
true ${MODE:=host}
# Attach interface to container in guest mode
if [ "$MODE" == "guest" ]; then
echo "Attaching interface to container"
CONTAINER_ID=$(cat /proc/self/cgroup | grep -o -e "/docker/.*" | head -n 1| sed "s/\/docker\/\(.*\)/\\1/")
CONTAINER_PID=$(docker inspect -f '{{.State.Pid}}' ${CONTAINER_ID})
CONTAINER_IMAGE=$(docker inspect -f '{{.Config.Image}}' ${CONTAINER_ID})
docker run -t --privileged --net=host --pid=host --rm --entrypoint /bin/sh ${CONTAINER_IMAGE} -c "
PHY=\$(echo phy\$(iw dev ${INTERFACE} info | grep wiphy | tr ' ' '\n' | tail -n 1))
iw phy \$PHY set netns ${CONTAINER_PID}
"
ip link set ${INTERFACE} name wlan0
INTERFACE=wlan0
fi
if [ ! -f "/etc/hostapd.conf" ] ; then
cat > "/etc/hostapd.conf" <<EOF
interface=${INTERFACE}
driver=${DRIVER}
ssid=${SSID}
hw_mode=${HW_MODE}
channel=${CHANNEL}
wpa=2
wpa_passphrase=${WPA_PASSPHRASE}
wpa_key_mgmt=WPA-PSK
# TKIP is no secure anymore
#wpa_pairwise=TKIP CCMP
wpa_pairwise=CCMP
rsn_pairwise=CCMP
wpa_ptk_rekey=600
ieee80211n=1
ht_capab=${HT_CAPAB}
wmm_enabled=1
EOF
fi
# unblock wlan
rfkill unblock wlan
echo "Setting interface ${INTERFACE}"
# Setup interface and restart DHCP service
ip link set ${INTERFACE} up
ip addr flush dev ${INTERFACE}
ip addr add ${AP_ADDR}/24 dev ${INTERFACE}
# NAT settings
echo "NAT settings ip_dynaddr, ip_forward"
for i in ip_dynaddr ip_forward ; do
if [ $(cat /proc/sys/net/ipv4/$i) ]; then
echo $i already 1
else
echo "1" > /proc/sys/net/ipv4/$i
fi
done
cat /proc/sys/net/ipv4/ip_dynaddr
cat /proc/sys/net/ipv4/ip_forward
if [ "${OUTGOINGS}" ] ; then
ints="$(sed 's/,\+/ /g' <<<"${OUTGOINGS}")"
for int in ${ints}
do
echo "Setting iptables for outgoing traffics on ${int}..."
iptables -t nat -D POSTROUTING -s ${SUBNET}/24 -o ${int} -j MASQUERADE > /dev/null 2>&1 || true
iptables -t nat -A POSTROUTING -s ${SUBNET}/24 -o ${int} -j MASQUERADE
iptables -D FORWARD -i ${int} -o ${INTERFACE} -m state --state RELATED,ESTABLISHED -j ACCEPT > /dev/null 2>&1 || true
iptables -A FORWARD -i ${int} -o ${INTERFACE} -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -D FORWARD -i ${INTERFACE} -o ${int} -j ACCEPT > /dev/null 2>&1 || true
iptables -A FORWARD -i ${INTERFACE} -o ${int} -j ACCEPT
done
else
echo "Setting iptables for outgoing traffics on all interfaces..."
iptables -t nat -D POSTROUTING -s ${SUBNET}/24 -j MASQUERADE > /dev/null 2>&1 || true
iptables -t nat -A POSTROUTING -s ${SUBNET}/24 -j MASQUERADE
iptables -D FORWARD -o ${INTERFACE} -m state --state RELATED,ESTABLISHED -j ACCEPT > /dev/null 2>&1 || true
iptables -A FORWARD -o ${INTERFACE} -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -D FORWARD -i ${INTERFACE} -j ACCEPT > /dev/null 2>&1 || true
iptables -A FORWARD -i ${INTERFACE} -j ACCEPT
fi
echo "Configuring DHCP server .."
cat > "/etc/dhcp/dhcpd.conf" <<EOF
option domain-name-servers 8.8.8.8, 8.8.4.4;
option subnet-mask 255.255.255.0;
option routers ${AP_ADDR};
subnet ${SUBNET} netmask 255.255.255.0 {
range ${SUBNET::-1}100 ${SUBNET::-1}200;
}
EOF
echo "Starting DHCP server .."
dhcpd ${INTERFACE}
echo "Starting HostAP daemon ..."
/usr/sbin/hostapd /etc/hostapd.conf
+16
View File
@@ -0,0 +1,16 @@
FROM nginx:alpine
WORKDIR /var/www/
RUN apk add --update curl \
&& rm -rf /var/cache/apk/* \
&& wget https://github.com/hivemq/hivemq-mqtt-web-client/archive/master.zip \
&& unzip master.zip \
&& mv hivemq-mqtt-web-client-master hivemq-mqtt-web-client \
&& rm master.zip
ADD nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx"]
+24
View File
@@ -0,0 +1,24 @@
worker_processes 1;
daemon off;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
multi_accept off;
}
http {
include /etc/nginx/mime.types;
index index.html;
server {
listen *:80;
location / {
root /var/www/hivemq-mqtt-web-client;
}
}
}
+27
View File
@@ -0,0 +1,27 @@
FROM nodered/node-red:1.2.9
USER root
RUN apk update && apk upgrade && \
apk --no-cache add perl libpcap libpcap-dev bluez tcpdump iputils wget sshpass sudo && \
apk --no-cache add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing arp-scan && \
apk --no-cache add -X http://dl-cdn.alpinelinux.org/alpine/edge/community awake
RUN cd /tmp && \
wget http://www.mavetju.org/download/dhcpdump-1.8.tar.gz && \
tar -xzf ./dhcpdump-1.8.tar.gz && \
cd ./dhcpdump-1.8 && \
wget https://raw.githubusercontent.com/alexeicolin/dhcpdump-PKGBUILD/master/dhcpdump-1.8-includes.patch && \
patch -p1 < ./dhcpdump-1.8-includes.patch && \
ls && \
make && \
install -D dhcpdump /usr/bin/dhcpdump
RUN addgroup node-red dialout
RUN echo "node-red ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/node-red \
&& chmod 0440 /etc/sudoers.d/node-red
WORKDIR /usr/src/node-red
USER node-red
+89
View File
@@ -0,0 +1,89 @@
FROM node:lts-buster AS base
# Copy scripts
COPY scripts/*.sh /tmp/
RUN mkdir -p /usr/src/node-red /data && \
deluser --remove-home node && \
adduser --gecos "" --home /usr/src/node-red --disabled-login --uid 1000 node-red && \
chown -R node-red:node-red /data && \
chown -R node-red:node-red /usr/src/node-red && \
chmod +x /tmp/*.sh
# Install tools, create Node-RED app and data dir, add user and set rights
RUN set -ex && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
bash \
tzdata \
iputils-ping \
iputils-arping \
curl \
nano \
git \
openssl \
openssh-client
# Set work directory
WORKDIR /usr/src/node-red
# package.json contains Node-RED NPM module and node dependencies
COPY package.json .
#### Stage BUILD #######################################################################################################
FROM base AS build
# Install Build tools
RUN apt-get update && \
apt-get upgrade -y && \
apt-get -y install build-essential linux-headers-$(uname -r) udev python && \
npm install --unsafe-perm --no-update-notifier --only=production
RUN /tmp/remove_native_gpio.sh && \
cp -R node_modules prod_node_modules
#### Stage RELEASE #####################################################################################################
FROM base AS RELEASE
COPY --from=build /usr/src/node-red/prod_node_modules ./node_modules
# Chown, install devtools & Clean up
RUN chown -R node-red:node-red /usr/src/node-red && \
/tmp/install_devtools.sh && \
rm -r /tmp/*
RUN set -ex \
&& apt-get install -y wget sudo net-tools dhcpdump rfkill bluetooth bluez bluez-tools arp-scan libpcap-dev
RUN addgroup node-red sudo
RUN cat /dev/null > /etc/sudoers \
&& echo -e "Set disable_coredump false\n" > /etc/sudo.conf \
&& touch /etc/sudoers \
&& echo "node-red ALL=(ALL) NOPASSWD: ALL\n%sudo ALL=(ALL) NOPASSWD: ALL\n" > /etc/sudoers \
&& chmod 0440 /etc/sudoers
RUN apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
USER node-red
# Env variables
ENV NODE_RED_VERSION=$NODE_RED_VERSION \
NODE_PATH=/usr/src/node-red/node_modules:/data/node_modules \
FLOWS=flows.json
# ENV NODE_RED_ENABLE_SAFE_MODE=true # Uncomment to enable safe start mode (flows not running)
# ENV NODE_RED_ENABLE_PROJECTS=true # Uncomment to enable projects option
# User configuration directory volume
VOLUME ["/data"]
# Expose the listening port of node-red
EXPOSE 1880
# Add a healthcheck (default every 30 secs)
HEALTHCHECK CMD curl http://localhost:1880/ || exit 1
ENTRYPOINT ["npm", "start", "--", "--userDir", "/data"]
+35
View File
@@ -0,0 +1,35 @@
{
"name": "node-red-docker",
"version": "1.0.6",
"description": "Low-code programming for event-driven applications",
"homepage": "http://nodered.org",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/node-red/node-red-docker.git"
},
"main": "node_modules/node-red/red/red.js",
"scripts": {
"start": "node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS"
},
"contributors": [
{
"name": "Dave Conway-Jones"
},
{
"name": "Nick O'Leary"
},
{
"name": "James Thomas"
},
{
"name": "Raymond Mouthaan"
}
],
"dependencies": {
"node-red": "^1.0.6"
},
"engines": {
"node": ">=10"
}
}
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
set -ex
# Installing Devtools
if [[ ${TAG_SUFFIX} != "minimal" ]]; then
echo "Installing devtools"
apt-get install --yes build-essential linux-headers-$(uname -r) udev python python3
else
echo "Skip installing devtools"
fi
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
set -ex
# Remove native GPIO node if exists
if [[ -d "/usr/src/node-red/node_modules/@node-red/nodes/core/hardware" ]]; then
echo "Removing native GPIO node"
rm -r /usr/src/node-red/node_modules/@node-red/nodes/core/hardware
else
echo "Skip removing native GPIO node"
fi
+5
View File
@@ -0,0 +1,5 @@
FROM fauust/docker-systemd:debian-10
RUN apt-get update && apt-get upgrade --yes && apt-get install curl wget sudo procps --yes
RUN curl -sL https://install.raspap.com | bash -s -- --yes
+3
View File
@@ -0,0 +1,3 @@
FROM telegraf:1.17-alpine
RUN apk update && apk upgrade && \
apk --no-cache add unbound