Skip navigation
Reduced a Docker image from 1.37GB → 168MB.
0:00 / 1:11

Reduced a Docker image from 1.37GB → 168MB.

Anupam

@Anupam_Devops2.1K followers

Visit on X
2,184 likesDownloadOriginal post

157,923 views

Reduced a Docker image from 1.37GB → 168MB. Just by using multi-stage builds, slim base images, and cleaning unused dependencies. Small optimizations = faster CI/CD and safer containers.

24 Comments

Comments from the original post on X (Twitter)

  • Guptha Gudivada | DevOps & SRE's profile picture

    @Guptha933907

    @Gooner__14 Nice improvement. Smaller images not only speed up CI/CD but also reduce the attack surface and pull times across nodes, which really matters in large clusters.

    11 likes

  • Anupam's profile picture

    @Anupam_Devops

    Great analysis 😃👍

    2 likes

  • Pranav Shastri's profile picture

    @pranavz7

    @Gooner__14 It's good idea but careful you will be missing required tools.

    3 likes

  • Anupam's profile picture

    @Anupam_Devops

    Sure.

  • Patryk Golabek's profile picture

    @QuantumMentat

    @Gooner__14 Nice, I wrote a tool that might help with it. A dockerfile analyzer.

    2 likes

  • Royal's profile picture

    @royalland

    @Gooner__14 The guy who's just discovered Alpine...

    2 likes

  • Jude Mpacko's profile picture

    @judempacko

    @Gooner__14 Might reduce a few megabytes if you go for the Alpine version

    1 like

  • Anupam's profile picture

    @Anupam_Devops

    Yeah sure.

    1 like

  • neon light child 🇦🇷's profile picture

    @Aleas

    @Gooner__14 Using alpine instead of node, such wow.

    1 like

  • Noxeraph's profile picture

    @noxeraph

    @Gooner__14 you can go further with distroless images:

    1 like

  • Anupam's profile picture

    @Anupam_Devops

    Yeah sure.

  • Rowhit Sharma's profile picture

    @rohitwork42

    @Gooner__14 Everyone know this

    1 like

  • Emilio ⛩️'s profile picture

    @elashera

    @Gooner__14 this is the content i want to see! thanks

    1 like

  • Anupam's profile picture

    @Anupam_Devops

    Appreciate it Mate 🙌

  • LightShift Studio's profile picture

    @LightShiftHQ

    @Gooner__14 Wowza! Your container just shrunk down like magic 🧙‍♂️—from Mr.

    1 like

  • Valerii Petryniak's profile picture

    @vpetryniak

    @Gooner__14 Yep, and as result slower runtime since everything is optimised by and for glibc

    1 like

  • Mashood K's profile picture

    @fromcodetocloud

    @Gooner__14 perfect anupam & also it is popular interview question

    1 like

  • Anupam's profile picture

    @Anupam_Devops

    Yes I try to mostly share interview related content at the moment 🙂

    1 like

  • Michael J. Ryan🚩🇺🇲's profile picture

    @tracker1

    @Gooner__14 Also worth considering distroless and alpine where practical... Though alpine's libc (musl) usage is slightly slower than the glibc (gnu libc) you'd get from distro based slim images.

    1 like

  • Anupam's profile picture

    @Anupam_Devops

    Thanks for the input 🙂