<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Optimization on Besterry — Linux &amp; DevOps Notes</title><link>https://besterry.com/tags/optimization/</link><description>Recent content in Optimization on Besterry — Linux &amp; DevOps Notes</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 20 May 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://besterry.com/tags/optimization/index.xml" rel="self" type="application/rss+xml"/><item><title>Reducing Container Image Size: Multi-Stage Builds and Alpine</title><link>https://besterry.com/posts/container-image-size/</link><pubDate>Mon, 20 May 2024 00:00:00 +0000</pubDate><guid>https://besterry.com/posts/container-image-size/</guid><description>&lt;p&gt;Small images boot faster, save bandwidth, and have smaller attack surface. Here are the techniques that actually work.&lt;/p&gt;
&lt;h2 id="multi-stage-builds"&gt;Multi-stage builds&lt;/h2&gt;
&lt;p&gt;The single biggest win. Build in one stage, copy only the artifacts to a minimal runtime stage. A Go binary of 15 MB ends up in a 17 MB image. Compare to a naive golang:1.22 image at 900+ MB.&lt;/p&gt;
&lt;h2 id="base-image-choice"&gt;Base image choice&lt;/h2&gt;
&lt;p&gt;From smallest to largest for Go/Rust static binaries:&lt;/p&gt;</description></item></channel></rss>