Docker容器apt-get install找不到包

时间:2015-11-04 20:25:05

标签: linux node.js ubuntu docker

我正在尝试通过我拥有的node.js脚本来启动填充mongo的docker容器。

使用下面的脚本,我收到错误:

Step 2 : RUN apt-get update && apt-get install -y nodejs
 ---> Running in 7ed0f8e018e7
Get:1 http://security.debian.org wheezy/updates Release.gpg [1554 B]
Get:2 http://security.debian.org wheezy/updates Release [102 kB]
Get:3 http://httpredir.debian.org wheezy Release.gpg [2373 B]
Get:4 http://security.debian.org wheezy/updates/main amd64 Packages [405 kB]
Get:5 http://httpredir.debian.org wheezy-updates Release.gpg [1554 B]
Get:6 http://httpredir.debian.org wheezy Release [191 kB]
Get:7 http://httpredir.debian.org wheezy-updates Release [143 kB]
Get:8 http://httpredir.debian.org wheezy/main amd64 Packages [7637 kB]
Get:9 http://httpredir.debian.org wheezy-updates/main amd64 Packages [5788 B]
Fetched 8490 kB in 5s (1444 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package nodejs

使用此dockerfile:

FROM mongo:2.6.11

ENV NODE_ENV docker

RUN apt-get update && apt-get install -y nodejs

为什么apt-get找不到nodejs?

2 个答案:

答案 0 :(得分:2)

似乎我在RUN curl --silent --location https://deb.nodesource.com/setup_0.10 | bash -

之前遗失了apt-get install

答案 1 :(得分:0)

当您使用基于debian:wheezy的图片时,您可能需要查看https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions上旧发行版的注意