Skip to content

Commit 8107125

Browse files
authored
Merge branch 'node-red:master' into master
2 parents ea2a45f + 6df9b77 commit 8107125

File tree

8 files changed

+54
-26
lines changed

8 files changed

+54
-26
lines changed

.docker/Dockerfile.alpine

Lines changed: 5 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,8 @@ 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+
8286
USER node-red
8387

8488
# Env variables
@@ -96,4 +100,4 @@ EXPOSE 1880
96100
# Add a healthcheck (default every 30 secs)
97101
HEALTHCHECK CMD node /healthcheck.js
98102

99-
ENTRYPOINT ["npm", "--no-update-notifier", "--no-fund", "start", "--cache", "/data/.npm", "--", "--userDir", "/data"]
103+
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

README.md

Lines changed: 19 additions & 19 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,14 +146,14 @@ 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 |
@@ -167,39 +167,39 @@ The following table shows the provided Manifest Lists.
167167

168168
| **Tag** | **Node-RED Base Image** |
169169
|----------------------------------------|--------------------------------------------|
170-
| latest, 3.0.0, | nodered/node-red:3.0.0-16 |
171-
| 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 | |
172172
| | |
173173
| | |
174-
| latest-minimal, 3.0.0-minimal, | nodered/node-red:3.0.0-16-minimal |
175-
| 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 | |
176176

177177

178178
| **Tag** | **Node-RED Base Image** |
179179
|----------------------------------------|--------------------------------------------|
180-
| 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 |
181181
| | |
182-
| 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 |
183183

184184
| **Tag** | **Node-RED Base Image** |
185185
|----------------------------------------|--------------------------------------------|
186-
| 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 |
187187
| | |
188-
| 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
189189

190190

191191
With the support of Docker manifest list, there is no need to explicitly add the tag for the architecture to use.
192192
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.
193193

194194
Therefore all tags regarding Raspberry PI's are dropped.
195195

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: 6 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,8 @@ 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+
8084
USER node-red
8185

8286
# Env variables
@@ -94,4 +98,5 @@ EXPOSE 1880
9498
# Add a healthcheck (default every 30 secs)
9599
# HEALTHCHECK CMD curl http://localhost:1880/ || exit 1
96100

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

docker-custom/Dockerfile.debian

Lines changed: 5 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,8 @@ 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+
8185
USER node-red
8286

8387
# Env variables
@@ -95,4 +99,4 @@ EXPOSE 1880
9599
# Add a healthcheck (default every 30 secs)
96100
# HEALTHCHECK CMD curl http://localhost:1880/ || exit 1
97101

98-
ENTRYPOINT ["npm", "start", "--cache", "/data/.npm", "--", "--userDir", "/data"]
102+
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 $NODEOPTIONS 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",
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)