node.js - CircleCI:构建 Meteor 2.2 docker 应用程序 - 失败

标签 node.js docker meteor circleci circleci-workflows

如何得到这个错误?

我将 Meteor 2.2 与 Node 12.16.1 和 CircleCI 编译器一起使用@版本:2.1 以及最新的 docker 镜像。

我使用定制的 docker“meteor-launchpad”作为基地

我决定将我们的 Meteor 从 1.11.1 升级到 2.2

脚本命令失败:

meteor build --directory "$APP_BUNDLE_DIR"--server-only

“$APP_BUNDLE_DIR”是在创建“meteor-launchpad”镜像时设置的(已经在镜像中设置):

ENV APP_BUNDLE_DIR/opt/meteor/dist

这个错误在 1.11.1 Meteor 版本中不存在(现在也不存在)

在使用 Ubuntu 20 在我的本地服务器上创建镜像期间,此错误存在

我开发了自定义启动板并添加了一种使用任何 Meteor 版本的方法。效果是在 Meteor 1.11.1 上它能够在 CircleCI 上创建图像。

系统(基本镜像)上没有使用特殊用户。它是标准的:root @ debian:jessie

对于 Node :用户 Node 是用组 Node 创建的:

RUN groupadd -r node && useradd -m -g node node

我试过为用户授予某些组的访问权限,但没有效果:

RUN usermod -aG staff node
RUN usermod -aG node root

Meteor 的标志在启动板中设置:METEOR_ALLOW_SUPERUSER=true

我不确定去哪里寻找更多信息来解决这个问题。任何想法如何解决该错误?它说 PERM 错误表明一些权限问题,但安装由 root 用户处理。我需要为 CircleCI 设置任何环境值吗?

使用 Meteor (2.2) 的 CircleCI (2.1) 的详细错误:

[-] Building Meteor application...


Even with METEOR_ALLOW_SUPERUSER or --allow-superuser, permissions in your app
directory will be incorrect if you ever attempt to perform any Meteor tasks as
a normal user. If you need to fix your permissions, run the following command
from the **** of your project:

  sudo chown -Rh <username> .meteor/local

/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:218
      throw error;
      ^

Error: EPERM: operation not permitted, copyfile '/tmp/mt-1kbgw6u.nlqy/plugin.npm-check.os/npm/node_modules/meteor/babel-compiler/node_modules/resolve/.editorconfig' -> '/tmp/mt-1kbgw6u.nlqy/plugin.npm-check.os/npm/node_modules/meteor/babel-compiler/node_modules/.temp-ttjf6y.m2q6h/node_modules/resolve/.editorconfig'
    at Object.copyFileSync (fs.js:1907:3)
    at /****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1642:23
    at copyFile (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1697:3)
    at Object.cp_r (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:549:5)
    at /tools/isobuild/meteor-npm.js:429:11
    at Array.forEach (<anonymous>)
    at copyNpmPackageWithSymlinkedNodeModules (/tools/isobuild/meteor-npm.js:422:29)
    at /tools/isobuild/meteor-npm.js:358:7
    at Array.forEach (<anonymous>)
    at Object.rebuildIfNonPortable (/tools/isobuild/meteor-npm.js:345:27)
    at /tools/isobuild/bundler.js:428:19
    at Function._.each._.forEach (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:191:9)
    at Function.readDirsFromJSON (/tools/isobuild/bundler.js:427:9)
    at /tools/isobuild/bundler.js:2573:34
    at Function._.each._.forEach (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:186:9)
    at Function.readFromDisk (/tools/isobuild/bundler.js:2565:7)
    at Object.readJsImage (/tools/isobuild/bundler.js:3568:18)
    at /tools/isobuild/isopack.js:897:28
    at Function._.each._.forEach (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:186:9)
    at Isopack._loadUnibuildsFromPath (/tools/isobuild/isopack.js:894:7)
    at /tools/packaging/tropohouse.js:521:21
    at Function._.each._.forEach (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:186:9)
    at /tools/packaging/tropohouse.js:520:13
    at Object.enterJob (/tools/utils/buildmessage.js:388:12)
    at /tools/packaging/tropohouse.js:515:22
    at Object.enterJob (/tools/utils/buildmessage.js:388:12)
    at Object.download (/tools/packaging/tropohouse.js:427:20)
    at /tools/packaging/tropohouse.js:613:18
    at /tools/utils/buildmessage.js:609:21
    at /****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/fiber_pool.js:43:40
 => awaited here:
    at Promise.await (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:60:12)
    at Object.forkJoin (/tools/utils/buildmessage.js:641:6)
    at exports.Tropohouse.downloadPackagesMissingFromMap (/tools/packaging/tropohouse.js:609:18)
    at /tools/project-context.js:857:25
    at Object.enterJob (/tools/utils/buildmessage.js:388:12)
    at /tools/project-context.js:856:20
    at /tools/packaging/catalog/catalog.js:100:5
    at Object.capture (/tools/utils/buildmessage.js:283:5)
    at Object.catalog.runAndRetryWithRefreshIfHelpful (/tools/packaging/catalog/catalog.js:99:31)
    at ProjectContext._downloadMissingPackages (/tools/project-context.js:855:13)
    at /tools/project-context.js:300:9
    at Object.enterJob (/tools/utils/buildmessage.js:388:12)
    at ProjectContext._completeStagesThrough (/tools/project-context.js:290:18)
    at /tools/project-context.js:282:12
    at Function.run (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/tool-env/tools/tool-env/profile.ts:289:14)
    at ProjectContext.prepareProjectForBuild (/tools/project-context.js:281:13)
    at /tools/cli/commands.js:1010:20
    at Object.capture (/tools/utils/buildmessage.js:283:5)
    at Object.main.captureAndExit (/tools/cli/main.js:275:29)
    at buildCommand (/tools/cli/commands.js:1007:8)
    at /tools/cli/commands.js:948:25
    at Function.run (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/tool-env/tools/tool-env/profile.ts:289:14)
    at /tools/cli/commands.js:946:18
    at /****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/fiber_pool.js:43:40
 => awaited here:
    at Promise.await (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:60:12)
    at /tools/cli/main.js:1529:7 {
  errno: -1,
  syscall: 'copyfile',
  code: 'EPERM',
  path: '/tmp/mt-1kbgw6u.nlqy/plugin.npm-check.os/npm/node_modules/meteor/babel-compiler/node_modules/resolve/.editorconfig',
  dest: '/tmp/mt-1kbgw6u.nlqy/plugin.npm-check.os/npm/node_modules/meteor/babel-compiler/node_modules/.temp-ttjf6y.m2q6h/node_modules/resolve/.editorconfig'
}

最佳答案

CircleCI 已经为 CircleCI 的默认 Docker 17.09.0-ceNodeJS > 14.9.0:

https://support.circleci.com/hc/en-us/articles/360050934711

如果在 CircleCI 配置中使用 setup_remote_docker 键,像这样设置 Docker 版本可以解决问题:

      - setup_remote_docker:
          version: 19.03.13

关于node.js - CircleCI:构建 Meteor 2.2 docker 应用程序 - 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67505628/

相关文章:

javascript - 我如何在 Meteor 中扩展用户模型?

javascript - Meteor 函数执行两次

ios - 带有 AFNetworking 的嵌套 NSDictionary 和 NSArray 无法正常工作

docker - lein 环服务器在 docker 容器内抛出 java.io.FileNotFoundException

maven - 如何安装Eclipse Ditto

docker - Rancher 从本地机器拉取镜像(不是本地/远程注册表)

mongodb - 如何通过 mup 更改 meteor 部署中的 mongo 端口?

node.js - 如何使用 node.js 通过 ListMatchingProducts API 访问 Amazon mws 中的 10 多个产品

Visual Studio 的 Node.js 工具无法调试

javascript - Sinon.js 的意外行为