我正在尝试使用以下 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/