Skip to content
Advertisement

Docker container apt-get install can’t find package

I’m trying to spin up a docker container that populates mongo via a node.js script that I have.

With the script below, I get the error :

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

with this dockerfile:

FROM mongo:2.6.11

ENV NODE_ENV docker

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

Why does apt-get not find nodejs?

Advertisement

Answer

Seems i was missing RUN curl --silent --location https://deb.nodesource.com/setup_0.10 | bash - before the apt-get install

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement