TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Comparing Docker minimal image size for a JSON API in various languages

2 pointsby Fileformat3 months ago
Show HN: Docker minimal image size comparison for a simple JSON API in various programming languages<p>I implemented a simple JSON API in multiple programming languages. It is interesting to compare the sizes of the resulting Docker images.<p>Optimizing the images can really reduce the sizes, especially for interpreted languages: while you would expect Go and Rust to be small (and they are: 9 MB &amp; 5 MB respectively), Python and PHP are also surprisingly good: 60 MB and 51 MB.<p>Deno, Bun, NodeJS, .Net and Ruby are between 100 and 200 MB.<p>Ruby using bitami:ruby was over 500 MB. Switching to chainguard:ruby brought it down to 124 MB.<p>I haven&#x27;t optimized the Swift, Perl, Java &amp; Tcl images which are between 200 and 300 MB.<p>Proof that they actually run and work: <a href="https:&#x2F;&#x2F;www.regexplanet.com&#x2F;status.html" rel="nofollow">https:&#x2F;&#x2F;www.regexplanet.com&#x2F;status.html</a><p>Description of the API that they implement: <a href="https:&#x2F;&#x2F;github.com&#x2F;regexplanet&#x2F;regexplanet-next&#x2F;blob&#x2F;main&#x2F;CONTRIBUTING.md#backend-api">https:&#x2F;&#x2F;github.com&#x2F;regexplanet&#x2F;regexplanet-next&#x2F;blob&#x2F;main&#x2F;CO...</a>

2 comments

Alifatisk3 months ago
&gt; Ruby using bitami:ruby was over 500 MB<p>Oh my, half a gig!? Did you try to use Ruby:x-alpine? It&#x27;s around 5 MB.
red_Seashell_323 months ago
Unless I’m missing something, you’re copying dev dependencies for bun, instead of prod ones.
评论 #43035877 未加载