使用resin.io,我尝试将一个包含以下内容(仅一行)的Dockerfile部署到我的Raspberry pi设备上。
FROM nodered/node-red-docker:rpi-v8resin.io成功地构建了映像(参见下面的日志):
[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)但是,当在raspberry pi设备上部署它时,它报告了以下错误:
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据我说,主要的错误是:
27.10.18 23:15:00 (+0200)主10月27日21:15:00 -错误:听EACCES 0.0.0.0:80
这意味着Node-RED正在监听端口80,这是不允许的,因为用户不是root用户。
我认为这个错误可以通过配置节点红色来修正,这样它就不会监听端口80,而会监听端口1880。我不清楚如何做到这一点,我想要使用的特定场景是,我想使用我想要与resin.io一起部署的Docker映像not /nodered docker:rpi-v8。
我的问题:,如何保证Node-RED在使用resin.io部署图像符号/节点红色对接器:rpi-v8时正在监听端口1880?
发布于 2018-10-27 22:14:28
FYI:它被设置为80,就像在此之前一样,我已经部署了https://github.com/resin-io-projects/balena-node-red,为此我必须将端口设置为80。
node应用程序通过如下更改Dockerfile来侦听任何端口(最后添加了3行)。这种方法的优点是我们可以继续使用端口80,这意味着我们可以使用resin.io提供的公共url通过internet访问Node-RED编辑器和Node-RED ui。从提交/节点-红色-停靠:rpi-v8用户根运行sudo setcap 'cap_net_bind_service=+ep‘$(v8 -f
which node)用户节点-红色
https://stackoverflow.com/questions/53026557
复制相似问题