DEV Community

Build 100kB Docker Images from Scratch

Tony Metzidis on May 06, 2019

📓 The Gist You may think your 100mB Alpine images are small--but how about 100kB? Smaller images ship more quickly, and contain fewer attack vecto...
Collapse
 
suntong profile image
suntong

Not trying to be discouraging, but I've gone along that path before, and found the solution only good enough for hello-world toy programs. Real programs interact with OS in all kinds of ways. I.e., I'd like to see how a real-world program that interacts with OS in all kinds of ways can benefit from such 100kB Smaller images. That'll be really interesting. Thanks.

Collapse
 
tonymet profile image
Tony Metzidis

Good point. With a little diligence it can be done.

Here's a broader example building a rest api into a tiny container dev.to/tonymet/build-a-2mb-rest-ap...

Later on I'll show tooling you can use to help identify dependencies methodically so it seems less like voodoo

Collapse
 
suntong profile image
suntong

Loving it -- looking forward to your updates.

Collapse
 
david_j_eddy profile image
David J Eddy

Nicely done Tony. I look forward to the next article in the series.

Collapse
 
paulotruta profile image
Paulo Truta

This is top notch! Eagerly awaiting the next one! ;)

Collapse
 
tonymet profile image
Tony Metzidis

did a fast-follow on this, more to come in the coming posts

dev.to/tonymet/build-a-980-byte-do...

Collapse
 
adaamz profile image
Adam Žurek

Why you use Docker? If you use only tar it is much faster.

Collapse
 
tonymet profile image
Tony Metzidis

agreed about tar. Using docker here as an illustration on how to build optimized Docker images.