开源改变世界

Docker 镜像模块版本不匹配 #489

推推 grbl 3年前 (2023-02-03) 163次浏览
打开
2个任务完成
yohcop 打开了这个问题 2019 年 6 月 3 日 · 10 条评论
打开
2个任务完成

Docker 镜像模块版本不匹配#489

yohcop 打开了这个问题 2019 年 6 月 3 日 · 10 条评论

注释

Docker 镜像模块版本不匹配 #489

描述

Docker 镜像不启动,表示模块是针对不同的 Nodejs 版本编译的。

与 latest 和 v1.9.20 的结果相同(除了NODE_MODULE_VERSIONs 不同)

> sudo docker run cncjs/cncjs
[sudo] password for y: 
Unable to find image 'cncjs/cncjs:latest' locally
latest: Pulling from cncjs/cncjs
c5e155d5a1d1: Pull complete 
221d80d00ae9: Pull complete 
4250b3117dca: Pull complete 
3b7ca19181b2: Pull complete 
425d7b2a5bcc: Pull complete 
69df12c70287: Pull complete 
ad53476a61f2: Pull complete 
204bb8bac4a1: Pull complete 
f72f5ced5338: Pull complete 
6fe64b0754e2: Pull complete 
a6dfb1f83469: Pull complete 
b8a063378942: Pull complete 
Digest: sha256:aa682ea3616a6a2a5ef0f9573f31650a79361a2f1c2e29c958bde1d7fcffdcbc
Status: Downloaded newer image for cncjs/cncjs:latest
Error: Error: The module '/dist/cncjs/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:730:18)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at bindings (/dist/cncjs/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/dist/cncjs/node_modules/@serialport/bindings/lib/linux.js:1:98)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/dist/cncjs/node_modules/@serialport/bindings/lib/index.js:14:22)

和 1.9.20:

> docker run cncjs/cncjs:v1.9.20
[sudo] password for y: 
Unable to find image 'cncjs/cncjs:v1.9.20' locally
v1.9.20: Pulling from cncjs/cncjs
e79bb959ec00: Pull complete 
d4b7902036fe: Pull complete 
1b2a72d4e030: Pull complete 
d54db43011fd: Pull complete 
69d473365bb3: Pull complete 
6e2490ee2dc8: Pull complete 
24bcfd3d8296: Pull complete 
4c485b32137c: Pull complete 
10c7ea03b1e0: Pull complete 
7da3ff434f8a: Pull complete 
306d2f7957ad: Pull complete 
4ce325a7a1f4: Pull complete 
Digest: sha256:51a130be239e7a1686125eb484d921ab5e70dd5b9f227d4dc3b55b864142103f
Status: Downloaded newer image for cncjs/cncjs:v1.9.20
Error: Error: The module '/dist/cnc/node_modules/serialport/build/Release/serialport.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (module.js:682:18)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at bindings (/dist/cnc/node_modules/bindings/bindings.js:81:44)
    at Object.<anonymous> (/dist/cnc/node_modules/serialport/lib/bindings/linux.js:2:36)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/dist/cnc/node_modules/serialport/lib/bindings/auto-detect.js:16:22)

版本

  • CNCjs:1.9.20,最新

你如何安装CNCjs?

码头工人

硬件

  • 台式机或笔记本电脑

操作系统

  • Linux
Docker 镜像模块版本不匹配 #489

在 Linux 主机上,您可以使用以下 dockerfile 滚动图像

FROM cncjs/cncjs:v1.9.20
RUN apt-get update
RUN apt-get install -y udev          
RUN ./node_modules/.bin/electron-rebuild -f -v 2.0.18 --module-dir /dist/cnc/

解释:1.9.20使用nodejs v8作为系统默认值,但是构建使用的electrum版本使用了与系统不兼容的较新的自定义nodejs版本。尝试运行图像时,它再次使用系统 nodejs,因此失败。上面的 dockerfile 针对与系统版本 (ABI 57) 兼容的旧 electrum 版本重新编译串行端口依赖项。

注意:此“修复”不适用于最新版本,因为最新版本将系统 nodejs 提升到 v10(ABI 64)并且电子中没有匹配的 ABI。

Docker 镜像模块版本不匹配 #489
蚂蚁 评论了 2019 年 8 月 21 日  

MacOS Sierra 10.12.6 – 错误:

$ docker run --privileged -p 8000:8000 --rm --name cncjs cncjs/cncjs:latest
Error: Error: The module '/dist/cncjs/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:805:18)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at bindings (/dist/cncjs/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/dist/cncjs/node_modules/@serialport/bindings/lib/linux.js:1:36)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/dist/cncjs/node_modules/@serialport/bindings/lib/index.js:14:22)

尝试从 git 构建:

$ docker build -t cncjs/cncjs:rebuild .
Sending build context to Docker daemon  114.5MB
Step 1/8 : FROM node:10
 ---> f7949667ac49
Step 2/8 : MAINTAINER Cheton Wu <cheton@gmail.com>
 ---> Running in 4bc3d1659a5d
Removing intermediate container 4bc3d1659a5d
 ---> dd6dd9bbb903
Step 3/8 : ADD package.json package.json
 ---> 0543e53f8006
Step 4/8 : RUN npm i npm@latest -g
 ---> Running in 51d16a702fc9
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
+ npm@6.11.0
added 19 packages from 13 contributors, removed 15 packages and updated 52 packages in 16.269s
Removing intermediate container 51d16a702fc9
 ---> 92c0dd0fb61a
Step 5/8 : RUN npm install --production
 ---> Running in 5d52c55f2247
npm WARN deprecated @babel/polyfill@7.4.4: ? As of Babel 7.4.0, this
npm WARN deprecated package has been deprecated in favor of directly
npm WARN deprecated including core-js/stable (to polyfill ECMAScript
npm WARN deprecated features) and regenerator-runtime/runtime
npm WARN deprecated (needed to use transpiled generator functions):
npm WARN deprecated 
npm WARN deprecated   > import "core-js/stable";
npm WARN deprecated   > import "regenerator-runtime/runtime";
npm WARN deprecated bcrypt-nodejs@0.0.3: bcrypt-nodejs is no longer actively maintained. Please use bcrypt or bcryptjs. See https://github.com/kelektiv/node.bcrypt.js/wiki/bcrypt-vs-brypt.js to learn more about these two options
npm WARN deprecated superagent@3.8.3: Please note that v5.0.1+ of superagent removes User-Agent header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User-Agent header).  This notice will go away with v5.0.2+ once it is released.
npm WARN deprecated core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.

> @serialport/bindings@2.0.8 install /node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild


> core-js@2.6.9 postinstall /node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> final-form@4.12.0 postinstall /node_modules/final-form
> node -e "console.log('\u001b[35m\u001b[1mUsing final-form at work? You can now donate to our open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/final-form/donate\u001b[0m')"

Using final-form at work? You can now donate to our open collective:
 > https://opencollective.com/final-form/donate

> react-final-form@3.7.0 postinstall /node_modules/react-final-form
> node ./scripts/postinstall.js || exit 0

Use react-final-form at work? Consider supporting our development efforts at opencollective.com/final-form

> styled-components@3.4.10 postinstall /node_modules/styled-components
> node ./scripts/postinstall.js || exit 0

Use styled-components at work? Consider supporting our development efforts at opencollective.com/styled-components
npm WARN lifecycle cncjs@1.10.0~postinstall: cannot run in wd cncjs@1.10.0 opencollective postinstall (wd=/)
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN react-i18next@10.7.0 requires a peer of react@>= 16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-datepicker@1.5.0 requires a peer of react@^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-datepicker@1.5.0 requires a peer of react-dom@^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@17.1.1 requires a peer of eslint-plugin-import@^2.18.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@17.1.1 requires a peer of eslint-plugin-react@^7.14.2 but none is installed. You must install peer dependencies yourself.
npm WARN The package @babel/polyfill is included as both a dev and production dependency.

added 740 packages from 542 contributors and audited 23659 packages in 105.776s
found 11 vulnerabilities (4 low, 6 moderate, 1 high)
  run `npm audit fix` to fix them, or `npm audit` for details
Removing intermediate container 5d52c55f2247
 ---> 7fff11814637
Step 6/8 : ADD . .
 ---> 1f6634a741a7
Step 7/8 : EXPOSE 8000
 ---> Running in e327eb2eea48
Removing intermediate container e327eb2eea48
 ---> d263ffaf443f
Step 8/8 : CMD ["bin/cncjs"]
 ---> Running in 339d82613890
Removing intermediate container 339d82613890
 ---> 6e5641464cbe
Successfully built 6e5641464cbe
Successfully tagged cncjs/cncjs:rebuild

但不工作:

$ docker run --privileged -p 8000:8000 --rm --name cncjs cncjs/cncjs:rebuild
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '../dist/cncjs/server-cli'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/bin/cncjs:7:7)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
Docker 镜像模块版本不匹配 #489

您是否尝试过直接在 Mac OS 上构建而不是使用 docker?

如果你在 Mac 上安装了 node 和 npm,你可以这样做:

$ npm 安装 cncjs@latest

使用 docker 和 electron 只会给已经很复杂的构建过程增加一层复杂性——以及可能出错的地方。

实际上,很可能是以下快速安装说明#357(评论)也适用于 Mac OS。cncjs 构建过程创建了一组相当大的文件,这些文件是独立于平台的,唯一的例外是用于处理低级串行端口访问的依赖于平台的可执行文件。在 Raspberry Pi 上进行完整构建非常慢,而且经常由于资源耗尽而完全失败,所以我一直在寻找简化流程的方法。我确定了运行 cncjs 所需的最小文件集(在 Linux 下构建之后),然后创建了一个仅包含这些文件的 tarball。tarball 为 12 MB,与其他发行版映像相比很小。您可以在另一台机器上扩展该压缩包,然后为您的机器重建串口模块。在较慢的 Pi 上,它将 cncjs 更新时间从几小时减少到几分钟。

tarball 方法不会为您提供电子应用程序。您必须运行 cncjs 服务器,然后使用浏览器连接到它。对于那些不熟悉 Electron 的人来说,这是一种将 nodejs 服务器进程和浏览器捆绑在一个可执行文件中的方法。当您运行该可执行文件时,它会启动服务器进程和浏览器进程(与您可能已经运行的浏览器分开)并连接它们。它似乎是一个老式的应用程序,您可以在其中运行它并且 UI 会弹出 – 尽管在一段时间后会出现延迟,因为需要启动许多不同的(和大型的)程序。有很多地方可能出错。

Docker 镜像模块版本不匹配 #489
贡献者
米奇布拉德利 评论了 2019 年 8 月 21 日  

如果您对使用 docker 方法死心塌地,我想我知道一种修复它的方法。您将需要以交互方式运行 docker 容器:

docker run -i -t --privileged -p 8000:8000 --name cncjs cncjs/cncjs:latest /bin/bash

(注意没有 –rm 选项。使用该选项,将无法保存以下更改。)

然后,在运行的容器内:

root@26501939a4ba:/# npm uninstall dist/cncjs/node_modules/@serialport/bindings
root@26501939a4ba:/# npm install dist/cncjs/node_modules/@serialport/bindings
root@26501939a4ba:/# bin/cncjs

回到 docker shell,您可以将更改保存到新图像:

$ docker commit cncjs cncjs-fixed

然后运行新的 cncjs-fixed 图像。

$ docker run --privileged -p 8000:8000 --rm --name cncjs cncjs-fixed

可能有一种方法可以从 docker 命令行完成这一切,而不必进行交互,但我没有动力去弄明白。

Docker 镜像模块版本不匹配 #489

您是否尝试过直接在 Mac OS 上构建而不是使用 docker?

如果你在 Mac 上安装了 node 和 npm,你可以这样做:

$ npm 安装 cncjs@latest

使用 docker 和 electron 只会给已经很复杂的构建过程增加一层复杂性——以及可能出错的地方。

实际上,很可能是以下快速安装说明#357(评论)也适用于 Mac OS。cncjs 构建过程创建了一组相当大的文件,这些文件是独立于平台的,唯一的例外是用于处理低级串行端口访问的依赖于平台的可执行文件。在 Raspberry Pi 上进行完整构建非常慢,而且经常由于资源耗尽而完全失败,所以我一直在寻找简化流程的方法。我确定了运行 cncjs 所需的最小文件集(在 Linux 下构建之后),然后创建了一个仅包含这些文件的 tarball。tarball 为 12 MB,与其他发行版映像相比很小。您可以在另一台机器上扩展该压缩包,然后为您的机器重建串口模块。在较慢的 Pi 上,它将 cncjs 更新时间从几小时减少到几分钟。

tarball 方法不会为您提供电子应用程序。您必须运行 cncjs 服务器,然后使用浏览器连接到它。对于那些不熟悉 Electron 的人来说,这是一种将 nodejs 服务器进程和浏览器捆绑在一个可执行文件中的方法。当您运行该可执行文件时,它会启动服务器进程和浏览器进程(与您可能已经运行的浏览器分开)并连接它们。它似乎是一个老式的应用程序,您可以在其中运行它并且 UI 会弹出 – 尽管在一段时间后会出现延迟,因为需要启动许多不同的(和大型的)程序。有很多地方可能出错。

我比较喜欢用docker,比起直接在nodejs上产生依赖问题或者降级包,用docker做测试好用多了

如果您对使用 docker 方法死心塌地,我想我知道一种修复它的方法。您将需要以交互方式运行 docker 容器:

docker run -i -t --privileged -p 8000:8000 --name cncjs cncjs/cncjs:latest /bin/bash

(注意没有 –rm 选项。使用该选项,将无法保存以下更改。)

然后,在运行的容器内:

root@26501939a4ba:/# npm uninstall dist/cncjs/node_modules/@serialport/bindings
root@26501939a4ba:/# npm install dist/cncjs/node_modules/@serialport/bindings
root@26501939a4ba:/# bin/cncjs

回到 docker shell,您可以将更改保存到新图像:

$ docker commit cncjs cncjs-fixed

然后运行新的 cncjs-fixed 图像。

$ docker run --privileged -p 8000:8000 --rm --name cncjs cncjs-fixed

可能有一种方法可以从 docker 命令行完成这一切,而不必进行交互,但我没有动力去弄明白。

现在它可以工作但会产生一些错误;现在我可以对代码进行一些更改…

Docker 镜像模块版本不匹配 #489

任何更新?@voneiden的解决方案效果很好(版本 1.9.20),但我想更新我的容器以使用最新版本 (1.9.22)

Docker 镜像模块版本不匹配 #489

我采用了一种不同的方法,即暂时从 npm 存储库而不是源安装 cncjs 包。出于开发目的,这并不理想。但是,它将最新版本安装到容器中并正常运行。

例如:

FROM node:lts

RUN export debian_frontend=NONINTERACTIVE \
    && apt-get update && apt-get install -y udev \ 
    && apt-get autoclean -y && apt-get autoremove -y \
    && npm i npm@latest -g \
    && npm install -g cncjs@latest --unsafe-perm

EXPOSE 8000/tcp
CMD ["/usr/local/bin/cncjs"]
Docker 镜像模块版本不匹配 #489 dzervas 提到了这个问题 2020 年 11 月 7 日
4个任务
Docker 镜像模块版本不匹配 #489

只是一个参考点,我创建了 Dockerfile 基于@voneiden的推荐,而且看起来还不错。我以前遇到过同样的错误。

[node2] (local) root@192.168.0.27 ~
$ mkdir cncjs
[node2] (local) root@192.168.0.27 ~
$ cd cncjs/
[node2] (local) root@192.168.0.27 ~/cncjs
$ vi Dockerfile
[node2] (local) root@192.168.0.27 ~/cncjs
$ docker build -t cncjs/cncjs:rebuild .
Sending build context to Docker daemon  2.048kB
Step 1/4 : FROM cncjs/cncjs:v1.9.20
v1.9.20: Pulling from cncjs/cncjs
e79bb959ec00: Pull complete 
d4b7902036fe: Pull complete 
1b2a72d4e030: Pull complete 
d54db43011fd: Pull complete 
69d473365bb3: Pull complete 
6e2490ee2dc8: Pull complete 
24bcfd3d8296: Pull complete 
4c485b32137c: Pull complete 
10c7ea03b1e0: Pull complete 
7da3ff434f8a: Pull complete 
306d2f7957ad: Pull complete 
4ce325a7a1f4: Pull complete 
Digest: sha256:51a130be239e7a1686125eb484d921ab5e70dd5b9f227d4dc3b55b864142103f
Status: Downloaded newer image for cncjs/cncjs:v1.9.20
 ---> c5e90b6854f0
Step 2/4 : RUN apt-get update
 ---> Running in 4acc64b91b17
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2410 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [637 kB]
Get:7 http://deb.debian.org/debian stretch-updates/main amd64 Packages [2596 B]
Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7080 kB]
Fetched 7986 kB in 2s (3715 kB/s)
Reading package lists...
Removing intermediate container 4acc64b91b17
 ---> a99988257f00
Step 3/4 : RUN apt-get install -y udev
 ---> Running in d499ed128a24
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libkmod2 libudev1
The following NEW packages will be installed:
  libkmod2 udev
The following packages will be upgraded:
  libudev1
1 upgraded, 2 newly installed, 0 to remove and 124 not upgraded.
Need to get 1287 kB of archives.
After this operation, 7353 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 libkmod2 amd64 23-2 [48.1 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 libudev1 amd64 232-25+deb9u12 [126 kB]
Get:3 http://deb.debian.org/debian stretch/main amd64 udev amd64 232-25+deb9u12 [1113 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 1287 kB in 0s (25.7 MB/s)
Selecting previously unselected package libkmod2:amd64.
(Reading database ... 29978 files and directories currently installed.)
Preparing to unpack .../libkmod2_23-2_amd64.deb ...
Unpacking libkmod2:amd64 (23-2) ...
Preparing to unpack .../libudev1_232-25+deb9u12_amd64.deb ...
Unpacking libudev1:amd64 (232-25+deb9u12) over (232-25+deb9u9) ...
Setting up libudev1:amd64 (232-25+deb9u12) ...
Selecting previously unselected package udev.
(Reading database ... 29984 files and directories currently installed.)
Preparing to unpack .../udev_232-25+deb9u12_amd64.deb ...
Unpacking udev (232-25+deb9u12) ...
Setting up libkmod2:amd64 (23-2) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up udev (232-25+deb9u12) ...
Adding group `input' (GID 102) ...
Done.
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Removing intermediate container d499ed128a24
 ---> da028344861e
Step 4/4 : RUN ./node_modules/.bin/electron-rebuild -f -v 2.0.18 --module-dir /dist/cnc/
 ---> Running in 7a35273dc1b9
- Searching dependency tree
✔ Rebuild Complete
Removing intermediate container 7a35273dc1b9
 ---> c4759795256e
Successfully built c4759795256e
Successfully tagged cncjs/cncjs:rebuild
[node2] (local) root@192.168.0.27 ~/cncjs
$ docker run --privileged -p 8000:8000 --name cncjs cncjs/cncjs:rebuild
2020-12-28T23:00:45.264Z - info init Loading configuration from "/root/.cncrc"
2020-12-28T23:00:45.429Z - info init Starting the server at http://172.17.0.2:8000

参考的 Dockerfile:

FROM cncjs/cncjs:v1.9.20
RUN apt-get update
RUN apt-get install -y udev          
RUN ./node_modules/.bin/electron-rebuild -f -v 2.0.18 --module-dir /dist/cnc/
Docker 镜像模块版本不匹配 #489
以赛亚五世 评论了 2021 年 1 月 8 日  

根据安装说明,我能够在节点 12 上运行最新版本 (1.9.22)

文件

FROM ubuntu:latest

RUN apt-get update
RUN apt-get -y install udev
RUN apt-get -y install curl gnupg
RUN apt-get -y install git

RUN adduser --disabled-password --gecos "" cnc
RUN usermod -a -G tty cnc
RUN usermod -a -G dialout cnc

USER cnc

ENV NVM_DIR=/home/cnc/.nvm

RUN git clone https://github.com/creationix/nvm.git $NVM_DIR;
RUN cd $NVM_DIR; git checkout `git describe --abbrev=0 --tags`;
RUN . "$NVM_DIR/nvm.sh"; \
    nvm install 12; \
    nvm use 12; \
    npm install -g cncjs@1.9.22;

CMD . $NVM_DIR/nvm.sh && cncjs;

编辑:更新 dockerfile 以安装 udev 依赖项并更新用户权限

Docker 镜像模块版本不匹配 #489

如果能将它整合到https://hub.docker.com/r/cncjs/cncjs的“官方”Docker 容器中,那就太好了——我不确定feature-next我是否应该使用它,但:latest肯定有这个问题。

免费注册 在 GitHub 上加入此对话。已有帐户? 登录评论
项目
状态:分流
发展

没有分支机构或拉取请求

10人参加
Docker 镜像模块版本不匹配 #489Docker 镜像模块版本不匹配 #489Docker 镜像模块版本不匹配 #489Docker 镜像模块版本不匹配 #489Docker 镜像模块版本不匹配 #489Docker 镜像模块版本不匹配 #489Docker 镜像模块版本不匹配 #489Docker 镜像模块版本不匹配 #489Docker 镜像模块版本不匹配 #489Docker 镜像模块版本不匹配 #489

喜欢 (0)