You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide assumes you have some basic familiarity with Docker and the
12
-
[Docker Command Line](https://docs.docker.com/engine/reference/commandline/cli/). It describes some of the many ways Node-RED can be run under Docker and has support for multiple architectures (amd64, arm32v6, arm32v7and arm64v8).
11
+
[Docker Command Line](https://docs.docker.com/engine/reference/commandline/cli/). It describes some of the many ways Node-RED can be run under Docker and has support for multiple architectures (amd64, arm32v6, arm32v7, arm64v8 and s390x).
13
12
14
13
As of Node-RED 1.0 this project provides the build for the `nodered/node-red` container on [Docker Hub](https://hub.docker.com/r/nodered/node-red/). Note: the name has changed to nodered/node-red.
15
14
@@ -26,15 +25,15 @@ Let's dissect that command:
26
25
-it - attach a terminal session so we can see what is going on
27
26
-p 1880:1880 - connect local port 1880 to the exposed internal port 1880
28
27
--name mynodered - give this machine a friendly local name
29
-
nodered/node-red - the image to base it on - currently Node-RED v1.0.1
28
+
nodered/node-red - the image to base it on
30
29
31
30
32
31
Running that command should give a terminal window with a running instance of Node-RED.
33
32
34
33
Welcome to Node-RED
35
34
===================
36
35
37
-
03 Oct 12:57:10 - [info] Node-RED version: v1.0.1
36
+
03 Oct 12:57:10 - [info] Node-RED version: v1.0.2
38
37
03 Oct 12:57:10 - [info] Node.js version: v10.16.3
39
38
03 Oct 12:57:10 - [info] Linux 4.9.184-linuxkit x64 LE
40
39
03 Oct 12:57:11 - [info] Loading palette nodes
@@ -70,6 +69,8 @@ The advantage of doing this is that by giving it a name (mynodered) we can manip
70
69
more easily, and by fixing the host port we know we are on familiar ground.
71
70
Of course this does mean we can only run one instance at a time... but one step at a time folks...
72
71
72
+
**Note**: Currently there is a bug in Docker's architecture detection that fails for Arm6 CPU - eg Raspberry Pi Zero or 1. For these devices you currently need to specify the full build label, for example:
73
+
73
74
If we are happy with what we see, we can detach the terminal with `Ctrl-p``Ctrl-q` - the
74
75
container will keep running in the background.
75
76
@@ -95,7 +96,7 @@ The tag naming convention is `<node-red-version>-<node-version>-<image-type>-<ar
95
96
-`<image-type>` is type of image and is optional, can be either _none_ or minimal.
96
97
-_none_ : is the default and has Python 2 & Python 3 + devtools installed
97
98
- minimal : has no Python installed and no devtools installed
98
-
-`<architecture>` is the architecture of the Docker host system, can be either amd64, arm32v6, arm32v7, arm64.
99
+
-`<architecture>` is the architecture of the Docker host system, can be either amd64, arm32v6, arm32v7, arm64, or s390x
99
100
100
101
The minimal versions (without python and build tools) are not able to install nodes that require any locally compiled native code.
The Node-RED images are based on [official Node JS Alpine Linux](https://hub.docker.com/_/node/) images to keep them as small as possible.
108
109
Using Alpine Linux reduces the built image size, but removes standard dependencies that are required for native module compilation. If you want to add dependencies with native dependencies, extend the Node-RED image with the missing packages on running containers or build new images see [docker-custom](docker-custom/README.md).
109
110
110
-
The following table shows the variety of provided Node-RED images.
With the support of Docker manifest list, there is no need to explicitly add the tag for the architecture to use.
167
-
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.
168
-
169
-
Therefore all tags regarding Raspberry PI's are dropped.
170
-
171
-
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 `1.0.1-10-arm32v7`), and run the container.
111
+
See the [Github project README](https://github.com/node-red/node-red-docker/blob/master/README.md) for detailed Image, Tag and Manifest information.
112
+
113
+
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 `1.0.2-10-arm32v7`), and run the container.
172
114
```
173
115
docker run -it -p 1880:1880 --name mynodered nodered/node-red:latest
174
116
```
175
117
176
-
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 (`1.0.1-10-amd64`).
118
+
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 (`1.0.2-10-amd64`).
177
119
178
120
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.
179
121
122
+
**Note**: Currently there is a bug in Docker's architecture detection that fails for Arm6 CPU - eg Raspberry Pi Zero or 1. For these devices you currently need to specify the full build label, for example:
123
+
```
124
+
docker run -it -p 1880:1880 --name mynodered nodered/node-red:1.0.2-10-minimal-arm32v6
125
+
```
126
+
127
+
180
128
### Raspberry PI - native GPIO support
181
129
| v1.0 - BREAKING: Native GPIO support for Raspberry PI has been dropped |
182
130
| --- |
@@ -197,6 +145,7 @@ Disadvantages of the native GPIO support are:
197
145
198
146
For detailed install instruction please refer to the `node-red-node-pi-gpiod`[README](https://github.com/node-red/node-red-nodes/tree/master/hardware/pigpiod#node-red-node-pi-gpiod)
199
147
148
+
**Note**: There is a contributed [gpiod project](https://github.com/corbosman/node-red-gpiod) that runs the gpiod in its own container rather than on the host if required.
200
149
201
150
### Managing User Data
202
151
@@ -295,31 +244,6 @@ The above compose file:
295
244
- creates a node-red-net network and attaches the container to this network
296
245
- persists the `/data` dir inside the container to the `/mnt/docker-cluster/node-red/data` dir outside the container
297
246
298
-
### Project Layout
299
-
This repository contains Dockerfiles to build the Node-RED Docker images listed above.
300
-
301
-
#### package.json
302
-
303
-
The package.json is a metafile that downloads and installs the required version
304
-
of Node-RED and any other npms you wish to install at build time. During the
305
-
Docker build process, the dependencies are installed under `/usr/src/node-red`.
306
-
307
-
The main sections to modify are
308
-
309
-
"dependencies": {
310
-
"node-red": "^1.0.1", <-- set the version of Node-RED here
311
-
"node-red-dashboard": "*" <-- add any extra npm packages here
312
-
},
313
-
314
-
This is where you can pre-define any extra nodes you want installed every time
315
-
by default, and then
316
-
317
-
"scripts" : {
318
-
"start": "node-red -v $FLOWS"
319
-
},
320
-
321
-
This is the command that starts Node-RED when the container is run.
322
-
323
247
#### Startup
324
248
325
249
Node-RED is started using NPM start from this `/usr/src/node-red`, with the `--userDir`
@@ -347,51 +271,22 @@ Other useful environment variables include
347
271
- -e NODE_RED_ENABLE_SAFE_MODE=false # setting to true starts Node-RED in safe (not running) mode
348
272
- -e NODE_RED_ENABLE_PROJECTS=false # setting to true starts Node-RED with the projects feature enabled
349
273
350
-
351
-
#### Node-RED Admin Tool
352
-
353
-
Using the administration tool, with port forwarding on the container to the host
354
-
system, extra nodes can be installed without leaving the host system.
355
-
356
-
$ npm install -g node-red-admin
357
-
$ node-red-admin install node-red-node-openwhisk
358
-
359
-
This tool assumes Node-RED is available at the following address
360
-
`http://localhost:1880`.
361
-
362
-
Refreshing the browser page should now reveal the newly added node in the palette.
363
-
364
274
#### Container Shell
365
-
366
-
$ docker exec -it mynodered /bin/bash
275
+
```
276
+
$ docker exec -it mynodered /bin/bash
277
+
```
367
278
368
279
Will give a command line inside the container - where you can then run the npm install
369
280
command you wish - e.g.
370
-
371
-
$ cd /data
372
-
$ npm install node-red-node-smooth
373
-
$ exit
374
-
$ docker stop mynodered
375
-
$ docker start mynodered
376
-
377
-
Refreshing the browser page should now reveal the newly added node in the palette.
378
-
379
-
#### Building Custom Image
380
-
381
-
Creating a new Docker image, using the public Node-RED images as the base image,
382
-
allows you to install extra nodes during the build process.
383
-
384
-
This Dockerfile builds a custom Node-RED image with the flightaware module
385
-
installed from NPM.
386
-
387
281
```
388
-
FROM nodered/node-red
389
-
RUN npm install node-red-contrib-flightaware
282
+
$ cd /data
283
+
$ npm install node-red-node-smooth
284
+
$ exit
285
+
$ docker stop mynodered
286
+
$ docker start mynodered
390
287
```
391
288
392
-
Alternatively, you can modify the package.json in this repository and re-build
393
-
the images from scratch. This will also allow you to modify the version of
394
-
Node-RED that is installed. See [README](docker-custom/README.md) in the `docker-custom` directory.
289
+
Refreshing the browser page should now reveal the newly added node in the palette.
0 commit comments