nodejs 的安装返回了一个非零代码:1 with docker build

2 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
Run Code Online (Sandbox Code Playgroud)

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

curl -sL https://deb.nodesource.com/setup_6.x | bash -' returned a non-zero code: 1
Run Code Online (Sandbox Code Playgroud)

我没有在谷歌中找到任何相关的东西。

谢谢!

Mat*_*hew 5

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

$ 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:/#
Run Code Online (Sandbox Code Playgroud)

所以基本上那句话是告诉你你的 Ubunutu 版本还不支持。尝试更改您的配置文件以使用 ubuntu:16.04 - 或找出其他安装 node.js 的方法。