Docker Community Forums

Share and learn in the Docker community.

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


(Dorrfg) #1

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 security.debian.org jessie/updates InRelease [84.1 kB]
Get:2 http.debian.net jessie InRelease [206 kB]
Get:3 security.debian.org jessie/updates/main amd64 Packages [465 B]
Get:4 debian.net jessie-updates InRelease [117 kB]
Get:5 debian.net jessie/main amd64 Packages [9022 kB]
Get:6 debian.net jessie-updates/main amd64 Packages [20 B]
Fetched 9430 kB in 10s (942 kB/s)
W: Failed to fetch debian.net/debian/dists/jessie/main/binary-amd64/Packages 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.

Thanks.


(Sabin Basyal) #2

Hi dorrfg,

I think its related to this error and not particularly to docker:
http://forums.debian.net/viewtopic.php?f=10&t=112926


(Dorrfg) #3

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)