Settings

Theme

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

andrew.marcuse.info

2 points by Fileformat 10 months ago · 4 comments · 1 min read

Reader

Show HN: Docker minimal image size comparison for a simple JSON API in various programming languages

I implemented a simple JSON API in multiple programming languages. It is interesting to compare the sizes of the resulting Docker images.

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 & 5 MB respectively), Python and PHP are also surprisingly good: 60 MB and 51 MB.

Deno, Bun, NodeJS, .Net and Ruby are between 100 and 200 MB.

Ruby using bitami:ruby was over 500 MB. Switching to chainguard:ruby brought it down to 124 MB.

I haven't optimized the Swift, Perl, Java & Tcl images which are between 200 and 300 MB.

Proof that they actually run and work: https://www.regexplanet.com/status.html

Description of the API that they implement: https://github.com/regexplanet/regexplanet-next/blob/main/CO...

Alifatisk 10 months ago

> Ruby using bitami:ruby was over 500 MB

Oh my, half a gig!? Did you try to use Ruby:x-alpine? It's around 5 MB.

red_Seashell_32 10 months ago

Unless I’m missing something, you’re copying dev dependencies for bun, instead of prod ones.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection