node.js - 安装nodejs返回非零代码: 1 with docker build

标签 node.js docker dockerfile

我正在尝试使用以下 dockerfile 构建 docker 镜像:

FROM         ubuntu:16.10

MAINTAINER   Fátima Alves

COPY         ./dist /myprogram/
WORKDIR      /myprogram


RUN          apt-get update          \
                                  && \
             apt-get install -y      \
               curl                  \
                                  && \
             curl -sL https://deb.nodesource.com/setup_6.x | bash - \
                                  && \
             apt-get install -y      \
               python-dev            \
               libxml2-dev           \
               libxslt1-dev

无论我做什么,这条消息都会出现在终端中:

curl -sL https://deb.nodesource.com/setup_6.x | bash -' returned a non-zero code: 1

我在 Google 中没有找到任何相关内容。

谢谢!

最佳答案

您是否尝试过自己运行此命令以查看错误是什么?就像这样:

$ docker run --rm -it ubuntu:16.10
[...]
root@96117efa0948:/# apt-get update
[...]
root@96117efa0948:/# apt-get install -y curl
[...]
root@96117efa0948:/# curl -sL https://deb.nodesource.com/setup_6.x | bash -
[...]
## Your distribution, identified as "Ubuntu Yakkety Yak (development 
branch)", is a pre-release version of Ubuntu. NodeSource does not maintain 
official support for Ubuntu versions until they are formally released. You 
can try using the manual installation instructions available at 
https://github.com/nodesource/distributions and use the latest supported 
Ubuntu version name as the distribution identifier, although this is not 
guaranteed to work.
root@96117efa0948:/#

基本上,该简介是在告诉您您的 Ubunutu 版本尚不受支持。尝试更改您的配置文件以使用 ubuntu:16.04 - 或找出其他方法来安装 Node 。

关于node.js - 安装nodejs返回非零代码: 1 with docker build,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39084363/

相关文章:

coding-style - 如何正确处理 Node.JS 中的延迟操作?

javascript - 如何在node js的for循环中使用mysql查询

javascript - Node.js 中的事件循环是运行回调本身还是只是将回调传递给调用堆栈以便调用堆栈执行回调?

docker - 如何在代理后面的 dockerfile 中运行 `apt-get`?

Docker 容器无法访问本地网络 DNS

docker - 无法通过 URL 访问 Web 应用程序。从 Netscaler 到应用服务器的 SSL 连接失败

javascript - MQTT 客户端不工作

Dockerfile:重复 apt 缓存清理的好处

docker - 在 Docker 构建期间安装 Homebrew 软件包

amazon-web-services - Crontab没有凭证