Hacker News new | ask | show | jobs
by SOLAR_FIELDS 873 days ago
Dive is a great tool for debugging this. I like image reduction work just because it gives me a chance to play with Dive: https://github.com/wagoodman/dive

One easy low hanging fruit I see a LOT for ballooning image sizes is people including the kitchen sink SDK/CLI for their cloud provider (like AWS or GCP), when they really only need 1/100 of that. The full versions of both of these tools are several hundred mb each

3 comments

Can vouch for dive, the final system tree was generated by dive (should have acknowledged it, my bad)
dive is amazing. One thing I realized by using the tool is that chmoding a file from an earlier layer results in that file (in it's entirety) getting added to the current layer. E.g. the below Dockerfile creates an alpine image that is around double the size of the original alpine image:

    FROM alpine

    RUN chmod -R a+rwx bin dev home lib media mnt opt root run sbin srv tmp usr var
Do you have a link to a recommended guide to slimming down the cloud provider tools?