Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
&引用;您已将流星作为根运行”;在docker中构建meteor应用程序时_Meteor_Build_Root - Fatal编程技术网

&引用;您已将流星作为根运行”;在docker中构建meteor应用程序时

&引用;您已将流星作为根运行”;在docker中构建meteor应用程序时,meteor,build,root,Meteor,Build,Root,我在dockerfile中用 RUN ["meteor", "build", "--directory", "/meteor_app"] 并遇到以下错误: Step 11 : RUN meteor build --directory /meteor_app ---> Running in 2be64a8e21df You are attempting to run Meteor as the "root" user. If you are developing, this is almo

我在dockerfile中用

RUN ["meteor", "build", "--directory", "/meteor_app"]
并遇到以下错误:

Step 11 : RUN meteor build --directory /meteor_app
---> Running in 2be64a8e21df
You are attempting to run Meteor as the "root" user. If you are developing,
this is almost certainly *not* what you want to do and will likely result in
incorrect file permissions. However, if you are running this in a build process
(CI, etc.) or you are absolutely sure you know what you are doing, add the
`--unsafe-perm` flag to this command to proceed.
The command 'meteor build --directory /meteor_app' returned a non-zero code: 1
{"exitCode":8, "message":"docker build failed or timeout "}
在添加了
--unsafe--perm
标志后:

RUN ["meteor", "--unsafe-perm", "build", "--directory", "/meteor_app"]
错误仍然存在:

Step 11 : RUN meteor --unsafe-perm build --directory /meteor_app
---> Running in c0e79de335c7
You have run Meteor as root. Your permissions in your app directory will be
incorrect if you ever attempt to perform any Meteor tasks as your non-root
user. You probably didn't want this, but you can fix it by running the
following from the root of your project:
sudo chown -Rh <username> .meteor/local
'/meteor_app' is not a Meteor command. See 'meteor --help'.
The command 'meteor --unsafe-perm build --directory /meteor_app' returned a non-zero code: 1
{"exitCode":8, "message":"docker build failed or timeout "}
步骤11:运行meteor——不安全的perm构建——目录/meteor\u应用程序
--->在c0e79de335c7中运行
你以流星为根。您在应用程序目录中的权限将为
如果您试图以非root用户身份执行任何Meteor任务,则不正确
用户。您可能不希望出现这种情况,但可以通过运行
从项目的根目录执行以下操作:
sudo chown-右侧流星/本地
“/meteor_app”不是meteor命令。请参阅“流星-救命”。
命令'meteor--unsafe perm build--directory/meteor_app'返回一个非零代码:1
{“exitCode”:8,“消息”:“docker构建失败或超时”}
如何修复它

这个错误发生在Meteor 1.4.2之后,但我没有找到任何文档


谢谢

您可以通过在容器中创建一个用户,使用
user
命令切换到该用户,然后从那里运行meteor来解决此问题。这也是一种比以root身份运行一切更好的做法。

显然是一种自动流星更新,出于安全原因禁止root构建

解决了以root用户身份从meteor的应用程序根目录运行以下命令的问题:

export METEOR_NO_RELEASE_CHECK=true
curl https://install.meteor.com/?release=1.4.1.3 | sh
注意:您可以指定您选择的meteor版本


您能否提供有关如何执行此操作的分步说明?我正在使用meteorhacks/meteord:onbuild