Skip to content

Commit 092d09d

Browse files
author
Dave Conway-Jones
committed
Update docker.md
1 parent 1ae8e25 commit 092d09d

File tree

1 file changed

+26
-131
lines changed

1 file changed

+26
-131
lines changed

docs/getting-started/docker.md

Lines changed: 26 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ redirect_from:
77
- /docs/platforms/docker
88
---
99

10-
1110
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, arm32v7 and 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).
1312

1413
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.
1514

@@ -26,15 +25,15 @@ Let's dissect that command:
2625
-it - attach a terminal session so we can see what is going on
2726
-p 1880:1880 - connect local port 1880 to the exposed internal port 1880
2827
--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
3029

3130

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

3433
Welcome to Node-RED
3534
===================
3635

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
3837
03 Oct 12:57:10 - [info] Node.js version: v10.16.3
3938
03 Oct 12:57:10 - [info] Linux 4.9.184-linuxkit x64 LE
4039
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
7069
more easily, and by fixing the host port we know we are on familiar ground.
7170
Of course this does mean we can only run one instance at a time... but one step at a time folks...
7271

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+
7374
If we are happy with what we see, we can detach the terminal with `Ctrl-p` `Ctrl-q` - the
7475
container will keep running in the background.
7576

@@ -95,7 +96,7 @@ The tag naming convention is `<node-red-version>-<node-version>-<image-type>-<ar
9596
- `<image-type>` is type of image and is optional, can be either _none_ or minimal.
9697
- _none_ : is the default and has Python 2 & Python 3 + devtools installed
9798
- 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
99100

100101
The minimal versions (without python and build tools) are not able to install nodes that require any locally compiled native code.
101102

@@ -107,76 +108,23 @@ docker run -it -p 1880:1880 --name mynodered nodered/node-red:latest-minimal
107108
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.
108109
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).
109110

110-
The following table shows the variety of provided Node-RED images.
111-
112-
| **Tag** |**Node**| **Arch** | **Python** |**Dev**| **Base Image** |
113-
|----------------------------|--------|----------|------------|-------|------------------------|
114-
| 1.0.1-10-amd64 | 10 | amd64 | 2.x 3.x | yes | amd64/node:10-alpine |
115-
| 1.0.1-10-arm32v6 | 10 | arm32v6 | 2.x 3.x | yes | arm32v6/node:10-alpine |
116-
| 1.0.1-10-arm32v7 | 10 | arm32v7 | 2.x 3.x | yes | arm32v7/node:10-alpine |
117-
| 1.0.1-10-arm64v8 | 10 | arm64v8 | 2.x 3.x | yes | arm64v8/node:10-alpine |
118-
| | | | | | |
119-
| 1.0.1-10-minimal-amd64 | 10 | amd64 | no | no | amd64/node:10-alpine |
120-
| 1.0.1-10-minimal-arm32v6 | 10 | arm32v6 | no | no | arm32v6/node:10-alpine |
121-
| 1.0.1-10-minimal-arm32v7 | 10 | arm32v7 | no | no | arm32v7/node:10-alpine |
122-
| 1.0.1-10-minimal-arm64v8 | 10 | arm64v8 | no | no | arm64v8/node:10-alpine |
123-
124-
125-
| **Tag** |**Node**| **Arch** | **Python** |**Dev**| **Base Image** |
126-
|----------------------------|--------|----------|------------|-------|------------------------|
127-
| 1.0.1-12-amd64 | 12 | amd64 | 2.x 3.x | yes | amd64/node:12-alpine |
128-
| 1.0.1-12-arm32v6 | 12 | arm32v6 | 2.x 3.x | yes | arm32v6/node:12-alpine |
129-
| 1.0.1-12-arm32v7 | 12 | arm32v7 | 2.x 3.x | yes | arm32v7/node:12-alpine |
130-
| 1.0.1-12-arm64v8 | 12 | arm64v8 | 2.x 3.x | yes | arm64v8/node:12-alpine |
131-
| | | | | | |
132-
| 1.0.1-12-minimal-amd64 | 12 | amd64 | no | no | amd64/node:12-alpine |
133-
| 1.0.1-12-minimal-arm32v6 | 12 | arm32v6 | no | no | arm32v6/node:12-alpine |
134-
| 1.0.1-12-minimal-arm32v7 | 12 | arm32v7 | no | no | arm32v7/node:12-alpine |
135-
| 1.0.1-12-minimal-arm64v8 | 12 | arm64v8 | no | no | arm64v8/node:12-alpine |
136-
137-
- All images have bash, tzdata, nano, curl git and openssl tools pre-installed to support Node-RED's Projects feature.
138-
139-
### Manifest Lists
140-
The following table shows the provided Manifest Lists.
141-
142-
| **Tag** | **Node-RED Base Image** |
143-
|----------------------------------------|--------------------------------------------|
144-
| latest, 1.0.1, | nodered/node-red:1.0.1-10-amd64 |
145-
| latest-10, 1.0.1-10 | nodered/node-red:1.0.1-10-arm32v6 |
146-
| | nodered/node-red:1.0.1-10-arm32v7 |
147-
| | nodered/node-red:1.0.1-10-arm64v8 |
148-
| | |
149-
| latest-minimal, 1.0.1-minimal, | nodered/node-red:1.0.1-10-amd64-minimal |
150-
| latest-10-minimal, 1.0.1-10-minimal | nodered/node-red:1.0.1-10-arm32v6-minimal |
151-
| | nodered/node-red:1.0.1-10-arm32v7-minimal |
152-
| | nodered/node-red:1.0.1-10-arm64v8-minimal |
153-
154-
| **Tag** | **Node-RED Base Image** |
155-
|----------------------------------------|--------------------------------------------|
156-
| latest-12, 1.0.1-12 | nodered/node-red:1.0.1-12-amd64 |
157-
| | nodered/node-red:1.0.1-12-arm32v6 |
158-
| | nodered/node-red:1.0.1-12-arm32v7 |
159-
| | nodered/node-red:1.0.1-12-arm64v8 |
160-
| | |
161-
| latest-12-minimal, 1.0.1-12-minimal | nodered/node-red:1.0.1-12-amd64-minimal |
162-
| | nodered/node-red:1.0.1-12-arm32v6-minimal |
163-
| | nodered/node-red:1.0.1-12-arm32v7-minimal |
164-
| | nodered/node-red:1.0.1-12-arm64v8-minimal |
165-
166-
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.
172114
```
173115
docker run -it -p 1880:1880 --name mynodered nodered/node-red:latest
174116
```
175117

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`).
177119

178120
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.
179121

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+
180128
### Raspberry PI - native GPIO support
181129
| v1.0 - BREAKING: Native GPIO support for Raspberry PI has been dropped |
182130
| --- |
@@ -197,6 +145,7 @@ Disadvantages of the native GPIO support are:
197145

198146
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)
199147

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.
200149

201150
### Managing User Data
202151

@@ -295,31 +244,6 @@ The above compose file:
295244
- creates a node-red-net network and attaches the container to this network
296245
- persists the `/data` dir inside the container to the `/mnt/docker-cluster/node-red/data` dir outside the container
297246

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-
323247
#### Startup
324248

325249
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
347271
- -e NODE_RED_ENABLE_SAFE_MODE=false # setting to true starts Node-RED in safe (not running) mode
348272
- -e NODE_RED_ENABLE_PROJECTS=false # setting to true starts Node-RED with the projects feature enabled
349273

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-
364274
#### Container Shell
365-
366-
$ docker exec -it mynodered /bin/bash
275+
```
276+
$ docker exec -it mynodered /bin/bash
277+
```
367278

368279
Will give a command line inside the container - where you can then run the npm install
369280
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-
387281
```
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
390287
```
391288

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.
395290

396291
### Running headless
397292

0 commit comments

Comments
 (0)