首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误:听EACCES 0.0.0.0:80时,使用resin.io在覆盆子pi3上部署插入/节点红色对接者:rpi-v8的对接器映像

错误:听EACCES 0.0.0.0:80时,使用resin.io在覆盆子pi3上部署插入/节点红色对接者:rpi-v8的对接器映像
EN

Stack Overflow用户
提问于 2018-10-27 21:46:45
回答 1查看 1.8K关注 0票数 0

使用resin.io,我尝试将一个包含以下内容(仅一行)的Dockerfile部署到我的Raspberry pi设备上。

代码语言:javascript
复制
FROM nodered/node-red-docker:rpi-v8

resin.io成功地构建了映像(参见下面的日志):

代码语言:javascript
复制
[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设备上部署它时,它报告了以下错误:

代码语言:javascript
复制
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?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-27 22:14:28

  1. 我注意到,对于我的raspberry设备,设备服务变量"PORT“在resin.io中被设置为80。所以这个问题是通过改变到1880年来解决的。

FYI:它被设置为80,就像在此之前一样,我已经部署了https://github.com/resin-io-projects/balena-node-red,为此我必须将端口设置为80。

  1. 或者,我们可以允许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)用户节点-红色

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53026557

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档