Docker Community Forums

Share and learn in the Docker community.

Apt-get not working in node image? [showstopper]

Hi everyone.
I am building an image and encountering a problem with apt-get.
I distilled the problem to this. Try running this line. Does it fail for you as well?

sudo docker run --rm -it node:0.10.38 apt-get update
Get:1 jessie/updates InRelease [84.1 kB]
Get:2 jessie InRelease [206 kB]
Get:3 jessie/updates/main amd64 Packages [465 B]
Get:4 jessie-updates InRelease [117 kB]
Get:5 jessie/main amd64 Packages [9022 kB]
Get:6 jessie-updates/main amd64 Packages [20 B]
Fetched 9430 kB in 10s (942 kB/s)
W: Failed to fetch Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.

[links removed because I couldn’t post otherwise]
After this the build fails because of an error code.
If I try running the same command on a mysql container it works.
What is going on? :grimacing:

This is preventing my build server from creating new images and stopping my CI…
Please assist.


Hi dorrfg,

I think its related to this error and not particularly to docker:

Thanks for the response Sabin, it resolved itself somehow. Must have been a glitch in the apt-get repositories.
What I can write here is a related tip for a following problem I encountered:

When adding a layer that installs using apt-get install, you should always apt-get update before because you might rely on cache that is stale.
Meaning, write:
RUN apt-get update && apt-get install -y vim (or whatever you want)

Add the following to your dockerimage

RUN echo “deb stable main” > /etc/apt/sources.list
RUN echo “deb stable/updates main” > /etc/apt/sources.list

alternatively you need to manually add it to your sources.list