Docker Image Optimization

The cluster discusses techniques for reducing Docker image sizes, such as using layered caching, lightweight base images like Alpine or Distroless, and multi-stage builds, while debating trade-offs in maintenance, performance, and practicality.

📉 Falling 0.4x DevOps & Infrastructure
2,993
Comments
15
Years Active
5
Top Authors
#8797
Topic ID

Activity Over Time

2011
1
2013
74
2014
119
2015
152
2016
239
2017
217
2018
187
2019
258
2020
281
2021
240
2022
338
2023
345
2024
274
2025
257
2026
11

Keywords

landscape.cncf e.g MB CNCF FUSE FROM BPF FS CI docker.io docker containers layers images image layer container files config docker image

Sample Comments

sz4kerto Nov 5, 2019 View on HN

Docker images are layered, so this isn't a problem in most cases.

secondcoming Mar 16, 2022 View on HN

What has this got to do with making Docker images smaller?

AmericanBlarney Nov 30, 2021 View on HN

Those sound like issues with your Docker usage - there are options to keep base image quite streamlined (e.g. alpine or distroless images).

Already__Taken May 23, 2020 View on HN

That's weird won't these all be docker layers somewhere in the guts? So it's already compressed.

arthurwhite Nov 29, 2023 View on HN

Maybe not on their machine, but for Docker images that will be pulled a thousand times, yes.

mwcampbell Sep 12, 2018 View on HN

What do you find suboptimal about most Docker images? Just the size, or something else?

manigandham Jun 11, 2020 View on HN

Would it not be easier to just pack into different base images? Docker is very efficient with reusing these layers.

tuananh Feb 3, 2024 View on HN

ugh, i would hate to maintain this dockerfile. i actually dont mind a 34MB docker image vs a 17MB image like this

cstump Feb 26, 2016 View on HN

Short read on the current ways folks seem to be going about reducing their Docker image sizes

rowanG077 Oct 8, 2020 View on HN

You are just wasting cycles and memory. Don't use docker if you care about performance.