Skip to content

Commit 5b064ff

Browse files
hardillbknollearyNodeREDBotdschmidt
authored
Sync master to dev (#350)
* Updates for 3.0.0 - Bump the base Alpine build back to latest - Set NodeJS 16 as default - Drop NodeJS 12 - Add NodeJS 18 * Finish updating README.md * Update default versions in custom build scripts * Add 3.0.0-beta.1 * Merge 3.0.0 work into master (#317) * 2.2.0-beta.1 * Updates for NR 3.0.0 release (#311) * Updates for 3.0.0 - Bump the base Alpine build back to latest - Set NodeJS 16 as default - Drop NodeJS 12 - Add NodeJS 18 * Finish updating README.md * Update default versions in custom build scripts * Add 3.0.0-beta.1 * Bump to 3.0.0-beta.2 * Bump dev to 3.0.0-beta.3 (#314) * Remove Python 2 (#315) * Bump dev to 3.0.0-beta.3 * Remove Python2 from alpine builds * Bump to 3.0.0-beta.4 (#316) * Bump to 2.1.6 * Bump to 2.2.0 * Bump to 2.2.1 * Updates for 3.0.0 - Bump the base Alpine build back to latest - Set NodeJS 16 as default - Drop NodeJS 12 - Add NodeJS 18 * Bump to 3.0.0-beta.4 * Remove new empty line Co-authored-by: knolleary <[email protected]> Co-authored-by: Nick O'Leary <[email protected]> Co-authored-by: knolleary <[email protected]> * Bump to 3.0.0 (#318) Co-authored-by: knolleary <[email protected]> * Add PubkeyAccessKeyTypes settings (#323) * Add PubkeyAccessKeyTypes settings * Add PubkeyAccessKeyTypes settings * Add ssh fix to debian based build * New entrypoint (#324) * Add PubkeyAccessKeyTypes settings * Switch entrypoint to allow NR to run as root if needed This works round npm droping uid when running as root * Bump to 3.0.1 * First pass at fix for #326 (#327) Fix for #326 * Bump to 3.0.2 * Fix NODE_OPTIONS (#334) Thanks to @twocolors for finding this, applying from my id as having problems with easycla * Set python3 to be the default python for npm (#336) * Add stable release tag (#342) * Add a stable tag All 3.0.x will be tagged as nodered/node-red:3.0 All 3.1.x will be tagged as nodered/node-red:3.1 * Calculate Stable version rather than hard code it * Fix passing cli args to Node-RED (#349) The new entrypoint introduced #324 does not forward arguments to Node-RED. (which is a breaking change from 3.0.0) With this change the old behavior is restored and one can override settings via the docker command again. --------- Co-authored-by: Nick O'Leary <[email protected]> Co-authored-by: knolleary <[email protected]> Co-authored-by: NodeREDBot <[email protected]> Co-authored-by: Dominik Schmidt <[email protected]>
1 parent ef69ebf commit 5b064ff

File tree

9 files changed

+60
-28
lines changed

9 files changed

+60
-28
lines changed

.docker/Dockerfile.alpine

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ WORKDIR /usr/src/node-red
3535
# Setup SSH known_hosts file
3636
COPY .docker/known_hosts.sh .
3737
RUN ./known_hosts.sh /etc/ssh/ssh_known_hosts && rm /usr/src/node-red/known_hosts.sh
38+
RUN echo "PubkeyAcceptedKeyTypes +ssh-rsa" >> /etc/ssh/ssh_config
3839

3940
# package.json contains Node-RED NPM module and node dependencies
4041
COPY package.json .
4142
COPY flows.json /data
43+
COPY .docker/scripts/entrypoint.sh .
4244

4345
#### Stage BUILD #######################################################################################################
4446
FROM base AS build
@@ -79,6 +81,9 @@ RUN chown -R node-red:root /usr/src/node-red && \
7981
/tmp/install_devtools.sh && \
8082
rm -r /tmp/*
8183

84+
RUN npm config set cache /data/.npm --global
85+
RUN npm config set python `which python3` --global
86+
8287
USER node-red
8388

8489
# Env variables
@@ -96,4 +101,4 @@ EXPOSE 1880
96101
# Add a healthcheck (default every 30 secs)
97102
HEALTHCHECK CMD node /healthcheck.js
98103

99-
ENTRYPOINT ["npm", "--no-update-notifier", "--no-fund", "start", "--cache", "/data/.npm", "--", "--userDir", "/data"]
104+
ENTRYPOINT ["./entrypoint.sh"]

.docker/scripts/entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../docker-custom/scripts/entrypoint.sh

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ jobs:
7171
IMAGE=${{ env.DEFAULT_IMAGE }}
7272
PUSH="true"
7373
VERSION=${TRAVIS_TAG:1}
74+
STABLE_VERSION=`echo ${VERSION} | sed -r 's/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$/\1.\2/'`
7475
7576
if [[ "${{ matrix.node }}" == "${{ env.LATEST_NODE }}" && "${{ matrix.suffix }}" == "" ]]; then
76-
TAGS="$TAGS,$IMAGE:$VERSION,$IMAGE:latest"
77+
TAGS="$TAGS,$IMAGE:$VERSION,$IMAGE:$STABLE_VERSION,$IMAGE:latest"
7778
elif [[ "${{ matrix.node }}" == "${{ env.LATEST_NODE }}" && "${{ matrix.suffix }}" == "-minimal" ]]; then
7879
TAGS="$TAGS,$IMAGE:$VERSION-minimal,$IMAGE:latest-minimal"
7980
fi

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ Let's dissect that command:
2626
-p 1880:1880 - connect local port 1880 to the exposed internal port 1880
2727
-v node_red_data:/data - mount the host node_red_data directory to the container /data directory so any changes made to flows are persisted
2828
--name mynodered - give this machine a friendly local name
29-
nodered/node-red - the image to base it on - currently Node-RED v3.0.0
29+
nodered/node-red - the image to base it on - currently Node-RED v3.0.2
3030

3131

3232
Running that command should give a terminal window with a running instance of Node-RED.
3333

3434
Welcome to Node-RED
3535
===================
3636

37-
10 Oct 12:57:10 - [info] Node-RED version: v3.0.0
37+
10 Oct 12:57:10 - [info] Node-RED version: v3.0.2
3838
10 Oct 12:57:10 - [info] Node.js version: v16.14.1
3939
10 Oct 12:57:10 - [info] Linux 4.19.76-linuxkit x64 LE
4040
10 Oct 12:57:11 - [info] Loading palette nodes
@@ -114,14 +114,14 @@ The following table shows the variety of provided Node-RED images.
114114

115115
| **Tag** |**Node**| **Arch** | **Python** |**Dev**| **Base Image** |
116116
|----------------------------|--------|----------|------------|-------|----------------------------|
117-
| 3.0.0-14 | 14 | amd64 | 2.x 3.x | yes | amd64/node:14-alpine |
117+
| 3.0.2-14 | 14 | amd64 | 2.x 3.x | yes | amd64/node:14-alpine |
118118
| | 14 | arm32v6 | 2.x 3.x | yes | arm32v6/node:14-alpine |
119119
| | 14 | arm32v7 | 2.x 3.x | yes | arm32v7/node:14-alpine |
120120
| | 14 | arm64v8 | 2.x 3.x | yes | arm64v8/node:14-alpine |
121121
| | 14 | s390x | 2.x 3.x | yes | s390x/node:14-alpine |
122122
| | 14 | i386 | 2.x 3.x | yes | i386/node:14-alpine |
123123
| | | | | | |
124-
| 3.0.0-14-minimal | 14 | amd64 | no | no | amd64/node:14-alpine |
124+
| 3.0.2-14-minimal | 14 | amd64 | no | no | amd64/node:14-alpine |
125125
| | 14 | arm32v6 | no | no | arm32v6/node:14-alpine |
126126
| | 14 | arm32v7 | no | no | arm32v7/node:14-alpine |
127127
| | 14 | arm64v8 | no | no | arm64v8/node:14-alpine |
@@ -130,14 +130,14 @@ The following table shows the variety of provided Node-RED images.
130130

131131
| **Tag** |**Node**| **Arch** | **Python** |**Dev**| **Base Image** |
132132
|----------------------------|--------|----------|------------|-------|----------------------------|
133-
| 3.0.0-16 | 14 | amd64 | 2.x 3.x | yes | amd64/node:16-alpine |
133+
| 3.0.2-16 | 14 | amd64 | 2.x 3.x | yes | amd64/node:16-alpine |
134134
| | 14 | arm32v6 | 2.x 3.x | yes | arm32v6/node:16-alpine |
135135
| | 14 | arm32v7 | 2.x 3.x | yes | arm32v7/node:16-alpine |
136136
| | 14 | arm64v8 | 2.x 3.x | yes | arm64v8/node:16-alpine |
137137
| | 14 | s390x | 2.x 3.x | yes | s390x/node:16-alpine |
138138
| | 14 | i386 | 2.x 3.x | yes | i386/node:16-alpine |
139139
| | | | | | |
140-
| 3.0.0-16-minimal | 14 | amd64 | no | no | amd64/node:14-alpine |
140+
| 3.0.2-16-minimal | 14 | amd64 | no | no | amd64/node:14-alpine |
141141
| | 14 | arm32v6 | no | no | arm32v6/node:14-alpine |
142142
| | 14 | arm32v7 | no | no | arm32v7/node:14-alpine |
143143
| | 14 | arm64v8 | no | no | arm64v8/node:14-alpine |
@@ -146,60 +146,60 @@ The following table shows the variety of provided Node-RED images.
146146

147147
| **Tag** |**Node**| **Arch** | **Python** |**Dev**| **Base Image** |
148148
|----------------------------|--------|----------|------------|-------|----------------------------|
149-
| 3.0.0-18 | 18 | amd64 | 2.x 3.x | yes | amd64/node:18-alpine |
149+
| 3.0.2-18 | 18 | amd64 | 2.x 3.x | yes | amd64/node:18-alpine |
150150
| | 18 | arm32v6 | 2.x 3.x | yes | arm32v6/node:18-alpine |
151151
| | 18 | arm32v7 | 2.x 3.x | yes | arm32v7/node:18-alpine |
152152
| | 18 | arm64v8 | 2.x 3.x | yes | arm64v8/node:18-alpine |
153153
| | 18 | s390x | 2.x 3.x | yes | s390x/node:18-alpine |
154154
| | 18 | i386 | 2.x 3.x | yes | i386/node:18-alpine |
155155
| | | | | | |
156-
| 3.0.0-18-minimal | 18 | amd64 | no | no | amd64/node:18-alpine |
156+
| 3.0.2-18-minimal | 18 | amd64 | no | no | amd64/node:18-alpine |
157157
| | 18 | arm32v6 | no | no | arm32v6/node:18-alpine |
158158
| | 18 | arm32v7 | no | no | arm32v7/node:18-alpine |
159159
| | 18 | arm64v8 | no | no | arm64v8/node:18-alpine |
160160
| | 18 | s390x | no | no | s390x/node:18-alpine |
161161
| | 18 | i386 | no | no | i386/node:18-alpine |
162+
162163
- All images have bash, tzdata, nano, curl, git, openssl and openssh-client pre-installed to support Node-RED's Projects feature.
163164

164165
## Manifest Lists
165166
The following table shows the provided Manifest Lists.
166167

167168
| **Tag** | **Node-RED Base Image** |
168169
|----------------------------------------|--------------------------------------------|
169-
| latest, 3.0.0, | nodered/node-red:3.0.0-16 |
170-
| latest-16, 3.0.0-16 | |
170+
| latest, 3.0.2, | nodered/node-red:3.0.2-16 |
171+
| latest-16, 3.0.2-16 | |
171172
| | |
172173
| | |
173-
| latest-minimal, 3.0.0-minimal, | nodered/node-red:3.0.0-16-minimal |
174-
| latest-16-minimal, 3.0.0-16-minimal | |
174+
| latest-minimal, 3.0.2-minimal, | nodered/node-red:3.0.2-16-minimal |
175+
| latest-16-minimal, 3.0.2-16-minimal | |
175176

176177

177178
| **Tag** | **Node-RED Base Image** |
178179
|----------------------------------------|--------------------------------------------|
179-
| latest-14, 3.0.0-14 | nodered/node-red:3.0.0-12 |
180+
| latest-14, 3.0.2-14 | nodered/node-red:3.0.2-12 |
180181
| | |
181-
| latest-14-minimal, 3.0.0-14-minimal | nodered/node-red:3.0.0-12-minimal |
182+
| latest-14-minimal, 3.0.2-14-minimal | nodered/node-red:3.0.2-12-minimal |
182183

183184
| **Tag** | **Node-RED Base Image** |
184185
|----------------------------------------|--------------------------------------------|
185-
| latest-18, 3.0.0-18 | nodered/node-red:3.0.0-18 |
186+
| latest-18, 3.0.2-18 | nodered/node-red:3.0.2-18 |
186187
| | |
187-
| latest-18-minimal, 3.0.0-18-minimal | nodered/node-red:3.0.0-18-minimal
188+
| latest-18-minimal, 3.0.2-18-minimal | nodered/node-red:3.0.2-18-minimal
188189

189190

190191
With the support of Docker manifest list, there is no need to explicitly add the tag for the architecture to use.
191192
When a docker run command or docker service command or docker stack command is executed, docker checks which architecture is required and verifies if it is available in the docker repository. If it does, docker pulls the matching image for it.
192193

193194
Therefore all tags regarding Raspberry PI's are dropped.
194195

195-
196-
For example: suppose you are running on a Raspberry PI 3B, which has `arm32v7` as architecture. Then just run the following command to pull the image (tagged by `3.0.0-16`), and run the container.
196+
For example: suppose you are running on a Raspberry PI 3B, which has `arm32v7` as architecture. Then just run the following command to pull the image (tagged by `3.0.2-16`), and run the container.
197197

198198
```
199199
docker run -it -p 1880:1880 -v node_red_data:/data --name mynodered nodered/node-red:latest
200200
```
201201

202-
The same command can be used for running on an amd64 system, since docker discovers its running on a amd64 host and pulls the image with the matching tag (`3.0.0-16-amd64`).
202+
The same command can be used for running on an amd64 system, since docker discovers its running on a amd64 host and pulls the image with the matching tag (`3.0.2-16-amd64`).
203203

204204
This gives the advantage that you don't need to know/specify which architecture you are running on and makes docker run commands and docker compose files more flexible and exchangeable across systems.
205205

@@ -334,7 +334,7 @@ Docker build process, the dependencies are installed under `/usr/src/node-red`.
334334
The main sections to modify are
335335

336336
"dependencies": {
337-
"node-red": "^3.0.0", <-- set the version of Node-RED here
337+
"node-red": "^3.0.2", <-- set the version of Node-RED here
338338
"node-red-dashboard": "*" <-- add any extra npm packages here
339339
},
340340

docker-custom/Dockerfile.custom

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ WORKDIR /usr/src/node-red
3434
# Setup SSH known_hosts file
3535
COPY known_hosts.sh .
3636
RUN ./known_hosts.sh /etc/ssh/ssh_known_hosts && rm /usr/src/node-red/known_hosts.sh
37+
RUN echo "PubkeyAcceptedKeyTypes +ssh-rsa" >> /etc/ssh/ssh_config
3738

3839
# package.json contains Node-RED NPM module and node dependencies
3940
COPY package.json .
4041
COPY flows.json /data
42+
COPY scripts/entrypoint.sh .
4143

4244
#### Stage BUILD #######################################################################################################
4345
FROM base AS build
@@ -77,6 +79,9 @@ RUN chown -R node-red:root /usr/src/node-red && \
7779
/tmp/install_devtools.sh && \
7880
rm -r /tmp/*
7981

82+
RUN npm config set cache /data/.npm --global
83+
RUN npm config set python `which python3` --global
84+
8085
USER node-red
8186

8287
# Env variables
@@ -94,4 +99,5 @@ EXPOSE 1880
9499
# Add a healthcheck (default every 30 secs)
95100
# HEALTHCHECK CMD curl http://localhost:1880/ || exit 1
96101

97-
ENTRYPOINT ["npm", "start", "--cache", "/data/.npm", "--", "--userDir", "/data"]
102+
# ENTRYPOINT ["npm", "start", "--cache", "/data/.npm", "--", "--userDir", "/data"]
103+
ENTRYPOINT ["./entrypoint.sh"]

docker-custom/Dockerfile.debian

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ WORKDIR /usr/src/node-red
3535
# Setup SSH known_hosts file
3636
COPY known_hosts.sh .
3737
RUN ./known_hosts.sh /etc/ssh/ssh_known_hosts && rm /usr/src/node-red/known_hosts.sh
38+
RUN echo "PubkeyAcceptedKeyTypes +ssh-rsa" >> /etc/ssh/ssh_config
3839

3940
# package.json contains Node-RED NPM module and node dependencies
4041
COPY package.json .
4142
COPY flows.json /data
43+
COPY scripts/entrypoint.sh .
4244

4345
#### Stage BUILD #######################################################################################################
4446
FROM base AS build
@@ -78,6 +80,9 @@ RUN chown -R node-red:root /usr/src/node-red && \
7880
apt-get update && apt-get install -y build-essential python-dev python3 && \
7981
rm -r /tmp/*
8082

83+
RUN npm config set cache /data/.npm --global
84+
RUN npm config set python `which python3` --global
85+
8186
USER node-red
8287

8388
# Env variables
@@ -95,4 +100,4 @@ EXPOSE 1880
95100
# Add a healthcheck (default every 30 secs)
96101
# HEALTHCHECK CMD curl http://localhost:1880/ || exit 1
97102

98-
ENTRYPOINT ["npm", "start", "--cache", "/data/.npm", "--", "--userDir", "/data"]
103+
ENTRYPOINT ["./entrypoint.sh"]

docker-custom/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-docker",
3-
"version": "3.0.0",
3+
"version": "3.0.2",
44
"description": "Low-code programming for event-driven applications",
55
"homepage": "http://nodered.org",
66
"license": "Apache-2.0",
@@ -29,7 +29,7 @@
2929
}
3030
],
3131
"dependencies": {
32-
"node-red": "3.0.0"
32+
"node-red": "3.0.2"
3333
},
3434
"engines": {
3535
"node": ">=12"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
trap stop SIGINT SIGTERM
4+
5+
function stop() {
6+
kill $CHILD_PID
7+
wait $CHILD_PID
8+
}
9+
10+
/usr/local/bin/node $NODE_OPTIONS node_modules/node-red/red.js --userDir /data $FLOWS "${@}" &
11+
12+
CHILD_PID="$!"
13+
14+
wait "${CHILD_PID}"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-docker",
3-
"version": "3.0.0-beta.4",
3+
"version": "3.0.2",
44
"description": "Low-code programming for event-driven applications",
55
"homepage": "http://nodered.org",
66
"license": "Apache-2.0",
@@ -29,7 +29,7 @@
2929
}
3030
],
3131
"dependencies": {
32-
"node-red": "3.0.0"
32+
"node-red": "3.0.2"
3333
},
3434
"engines": {
3535
"node": ">=12"

0 commit comments

Comments
 (0)