4 ms·
The new game of Docker Golf. I once spent like a day trying to debug an issue with pruning dev dependencies from my prod docker image before I stopped to realiz
by tootie 8y ago
The new game of Docker Golf. I once spent like a day trying to debug an issue with pruning dev dependencies from my prod docker image before I stopped to realized how much money I was wasting to save $0.0001 of cloud disk space. It is kinda fun though.
- nine_k 8y agoCloud disk space for an executable file costs nothing compared to potential losses if that executable is used for cracking into your installation. It could be either via a hole in that executable, or just by using the executable to greatly simplify the penetration and / or privilege escalation.
- always_good 8y agoReminds me of how I'll spend an afternoon avoiding a copy in Rust. It's kinda fun, but hard to remain deluded that you're doing it for serious technical purposes.
- heavenlyblue 8y agoThen the next day you realise the next feature actually requires a copy anyway... :)
- schwuk 8y agoIt's not (only) about the storage space; it's the upload too. That time investment will get paid back over multiple deployments. That said, now I have "good" broadband, I pay a lot less attention to the image size.
- drinchev 8y agoThat's something that I ask myself everyday. Is it worth it to push the big O notation to the limit, saving couple of megabytes RAM or I can simply deliver and have a happy boss. I've always been fond of "premature optimisation is the root of all evil" [1], but still... wasting resources makes me feel bad. I feel like the guy that buys 10 plastic bottles of 0.5l water instead of 2x2.5 litres. The guys building ( owning ) Slack, cryptocurrencies, e-commerce websites are on the other end though. I hardly can count a day when my MacBook's fan doesn't spin like crazy, because I'm just visiting an HTML page to read the text. In other words. Yeah ... you can save some precious time to optimise that, because you don't want to be the person that starts the fans of colleagues' Macs ( having a docker image with your app running on my Mac ). Energy is what you are saving and that's priceless in today's polluted world. 1: http://wiki.c2.com/?PrematureOptimization http://wiki.c2.com/?PrematureOptimization
- hinkley 8y agoMake it Work, Make it Right, Make it Fast. On several projects the management and sales team were at odds with the dev team about app performance. They wanted it faster and the dev team was full of premature optimization cargo cult members. By cult member, I mean people who say that phrase to get out of thinking. The line between right and fast is blurry. There’s a big chunk of refactorings that improve readability and performance and if you work with those you get better at your job, avoid the cult members and please the business. Now that I’ve typed that last paragraph I want to go through Refactoring and categorize the ones that fall under “right and fast”...
- jay-anderson 8y agoVery much agreed. Like all things balance is needed. Often it's worth thinking about performance during initial design. There's the idea that fixing bugs earlier in development is cheaper. This also applies to performance issues. That's not to say you spend an inordinate amount of time focusing on just that, but it needs to be given its due.
- cyphar 8y agoThe thing is, Docker Golf is possibly the worst way to optimise the real costs of container images -- because it comes at the cost of maintenance (distributions exist for a reason). A much better solution is to fix the image format to better handle the usecases that it needs to handle. (This is what I'm working on at the moment.)
- weberc2 8y agoIf there is a practical advantage, I think it's reducing the attack surface. I recently made an image that was a single statically-linked binary, some certs, and an /etc/passwd file all on top of a scratch base image. I did this because our organization's compliance team has only greenlighted Centos and scratch base images (no idea whether or not this is a particularly good policy) and I opted for scratch because it was marginally more effort for several small gains (reduced attack surface, faster deploys, faster builds, faster pulls, etc).
- CardenB 8y agoAmdahl’s law in practice