docker-library / node

DEPRECATED; image taken over by Node upstream
https://github.com/joyent/docker-node
MIT License
81 stars 36 forks source link

Clean apt-get to reduce image size #24

Closed stp-ip closed 10 years ago

stp-ip commented 10 years ago

Reduces image sizes by another 7 MB each.

stp-ip commented 10 years ago

Removed cleanup command and reassured tabs are used.

tianon commented 10 years ago

I think the 7MB is coming entirely from /var/lib/apt/lists - I've run some tests locally with a container and using docker diff <container> to check what's changed, and /var/cache/apt is created, but nothing in it ever sticks around after the apt-get install completes.

root@45a24dc9b5db:/# du -hs /var/lib/apt/lists 
8.0M    /var/lib/apt/lists
stp-ip commented 10 years ago

Cache doesn't keep things around most of the time. I added it for rare edge cases and to show more general best practices. But if need be I can edit it out.

tianon commented 10 years ago

So, the Debian images all have this: https://github.com/docker/docker/blob/1aa67071cb3e6bc8a08f662d913cdb1b1eda1645/contrib/mkimage/debootstrap#L82-L83

Don't Dir::Cache::pkgcache and Dir::Cache::srcpkgcache essentially disable the cache entirely?

stp-ip commented 10 years ago

@tianon so your take would be to just remove the cache removal anyway?

tianon commented 10 years ago

Yeah, since it isn't really buying us anything like the lists removal does.

stp-ip commented 10 years ago

Pushed the latest change and squashed all commits.

yosifkit commented 10 years ago

LGTM

tianon commented 10 years ago

LGTM

tianon commented 10 years ago

Thanks :smile: