Using resin.io I tried to deploy a Dockerfile with following content (only 1 line) to my Raspberry pi device.
FROM nodered/node-red-docker:rpi-v8
resin.io successfully built the image (see following log):
[Success] Successfully uploaded images
[Success] Release successfully created!
[Info] Release: ff11126a791e453d6790b9702290cd5a962c79f6 (id: 646158)
[Info] ┌─────────┬────────────┬────────────┐
[Info] │ Service │ Image Size │ Build Time │
[Info] ├─────────┼────────────┼────────────┤
[Info] │ main │ 536.19 MB │ 26 seconds │
[Info] └─────────┴────────────┴────────────┘
[Info] Build finished in 1 minute, 20 seconds
\
\
\\
\\
>\/7
_.-(6' \
(=___._/` \
) \ |
/ / |
/ > /
j < _\
_.-' : ``.
\ r=._\ `.
<`\\_ \ .`-.
\ r-7 `-. ._ ' . `\
\`, `-.`7 7) )
\/ \| \' / `-._
|| .'
\\ (
>\ >
,.-' >.'
<.'_.''
<'
To git.resin.io:gh_janvda/pi3four.git
+ 173e46e...ff11126 master -> master (forced update)
but when deploying it on the raspberry pi device it reported following error:
27.10.18 23:14:51 (+0200) main mount: only root can use "--types" option
27.10.18 23:14:51 (+0200) main mount: only root can use "--move" option
27.10.18 23:14:51 (+0200) main mount: only root can use "--move" option
27.10.18 23:14:51 (+0200) main mount: only root can use "--move" option
27.10.18 23:14:51 (+0200) main mount: only root can use "--move" option
27.10.18 23:14:51 (+0200) main umount: /dev: umount failed: Operation not permitted
27.10.18 23:14:51 (+0200) main mount: only root can use "--move" option
27.10.18 23:14:51 (+0200) main ln: cannot remove ‘/dev/ptmx’: Permission denied
27.10.18 23:14:51 (+0200) main mount: only root can use "--types" option
27.10.18 23:14:51 (+0200) main /sbin/udevd
27.10.18 23:14:52 (+0200) main npm info it worked if it ends with ok
27.10.18 23:14:52 (+0200) main npm info using npm@5.0.3
27.10.18 23:14:52 (+0200) main npm info using node@v8.1.3
27.10.18 23:14:53 (+0200) main [..................] \ : verb config Skipping project config: /usr/srcnpm info lifecycle node-red-docker@1.0.0~prestart: node-red-docker@1.0.0
27.10.18 23:14:53 (+0200) main [..................] / : info lifecycle node-red-docker@1.0.0~prestartnpm info lifecycle node-red-docker@1.0.0~start: node-red-docker@1.0.0
27.10.18 23:14:53 (+0200) main
27.10.18 23:14:53 (+0200) main > node-red-docker@1.0.0 start /usr/src/node-red
27.10.18 23:14:53 (+0200) main > node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"
27.10.18 23:14:53 (+0200) main
27.10.18 23:14:55 (+0200) main 27 Oct 21:14:55 - [info]
27.10.18 23:14:55 (+0200) main
27.10.18 23:14:55 (+0200) main Welcome to Node-RED
27.10.18 23:14:55 (+0200) main ===================
27.10.18 23:14:55 (+0200) main
27.10.18 23:14:55 (+0200) main 27 Oct 21:14:55 - [info] Node-RED version: v0.19.4
27.10.18 23:14:55 (+0200) main 27 Oct 21:14:55 - [info] Node.js version: v8.1.3
27.10.18 23:14:55 (+0200) main 27 Oct 21:14:55 - [info] Linux 4.14.39 arm LE
27.10.18 23:14:56 (+0200) main 27 Oct 21:14:56 - [info] Loading palette nodes
27.10.18 23:15:00 (+0200) main 27 Oct 21:15:00 - [info] Settings file : /data/settings.js
27.10.18 23:15:00 (+0200) main 27 Oct 21:15:00 - [info] Context store : 'default' [module=memory]
27.10.18 23:15:00 (+0200) main 27 Oct 21:15:00 - [info] User directory : /data
27.10.18 23:15:00 (+0200) main 27 Oct 21:15:00 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
27.10.18 23:15:00 (+0200) main 27 Oct 21:15:00 - [info] Flows file : /data/flows.json
27.10.18 23:15:00 (+0200) main 27 Oct 21:15:00 - [info] Creating new flow file
27.10.18 23:15:00 (+0200) main 27 Oct 21:15:00 - [warn]
27.10.18 23:15:00 (+0200) main
27.10.18 23:15:00 (+0200) main ---------------------------------------------------------------------
27.10.18 23:15:00 (+0200) main Your flow credentials file is encrypted using a system-generated key.
27.10.18 23:15:00 (+0200) main
27.10.18 23:15:00 (+0200) main If the system-generated key is lost for any reason, your credentials
27.10.18 23:15:00 (+0200) main file will not be recoverable, you will have to delete it and re-enter
27.10.18 23:15:00 (+0200) main your credentials.
27.10.18 23:15:00 (+0200) main
27.10.18 23:15:00 (+0200) main You should set your own key using the 'credentialSecret' option in
27.10.18 23:15:00 (+0200) main your settings file. Node-RED will then re-encrypt your credentials
27.10.18 23:15:00 (+0200) main file using your chosen key the next time you deploy a change.
27.10.18 23:15:00 (+0200) main ---------------------------------------------------------------------
27.10.18 23:15:00 (+0200) main
27.10.18 23:15:00 (+0200) main 27 Oct 21:15:00 - [info] Starting flows
27.10.18 23:15:00 (+0200) main 27 Oct 21:15:00 - [info] Started flows
27.10.18 23:15:00 (+0200) main 27 Oct 21:15:00 - [error] Uncaught Exception:
27.10.18 23:15:00 (+0200) main 27 Oct 21:15:00 - [error] Error: listen EACCES 0.0.0.0:80
27.10.18 23:15:00 (+0200) main at Object.exports._errnoException (util.js:1022:11)
27.10.18 23:15:00 (+0200) main at exports._exceptionWithHostPort (util.js:1045:20)
27.10.18 23:15:00 (+0200) main at Server.setupListenHandle [as _listen2] (net.js:1298:19)
27.10.18 23:15:00 (+0200) main at listenInCluster (net.js:1363:12)
27.10.18 23:15:00 (+0200) main at doListen (net.js:1489:7)
27.10.18 23:15:00 (+0200) main at _combinedTickCallback (internal/process/next_tick.js:105:11)
27.10.18 23:15:00 (+0200) main at process._tickCallback (internal/process/next_tick.js:161:9)
27.10.18 23:15:00 (+0200) main npm info lifecycle node-red-docker@1.0.0~start: Failed to exec start script
27.10.18 23:15:00 (+0200) main npm ERR! code ELIFECYCLE
27.10.18 23:15:00 (+0200) main npm ERR! errno 1
27.10.18 23:15:00 (+0200) main npm ERR! node-red-docker@1.0.0 start: `node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"`
27.10.18 23:15:00 (+0200) main npm ERR! Exit status 1
27.10.18 23:15:00 (+0200) main npm ERR!
27.10.18 23:15:00 (+0200) main npm ERR! Failed at the node-red-docker@1.0.0 start script.
27.10.18 23:15:00 (+0200) main npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
27.10.18 23:15:00 (+0200) main
27.10.18 23:15:00 (+0200) main npm ERR! A complete log of this run can be found in:
27.10.18 23:15:00 (+0200) main npm ERR! /usr/src/node-red/.npm/_logs/2018-10-27T21_15_00_316Z-debug.log
According to me the main error is:
27.10.18 23:15:00 (+0200) main 27 Oct 21:15:00 - [error] Error: listen EACCES 0.0.0.0:80
So this means that Node-RED is listening on port 80 which is not allowed as the user is not root.
I think that this error can be fixed by configuring node-red so that it is not listening to port 80 but to port 1880. It is not clear to me how I can do this the specific scenario where I want to use the Docker image nodered/node-red-docker:rpi-v8 which I want to deploy with resin.io.
My question: How can I assure that Node-RED is listening to port 1880 when deploying image nodered/node-red-docker:rpi-v8 using resin.io ?
FYI: it was set to 80 as before this I had deployed https://github.com/resin-io-projects/balena-node-red for which I had to set the port to 80.
node
application to listen to any port by changing the Dockerfile as follows (the last 3 lines are added). This approach has the advantage that we can keep using port 80 which means that we can access the Node-RED editor and Node-RED ui over the internet using the public url provided by resin.ioFROM nodered/node-red-docker:rpi-v8 USER root RUN sudo setcap 'cap_net_bind_service=+ep' $(eval readlink -f `which node`) USER node-red