---
title: "How I reduced the size of my very first published docker image by 40% - A lesson in dockerizing shell scripts"
url: https://daily.dev/posts/how-i-reduced-the-size-of-my-very-first-published-docker-image-by-40---a-lesson-in-dockerizing-shel-iuluj80no
source_url: https://bhupesh.me/publishing-my-first-ever-dockerfile-optimization-ugit/
type: article
source: "Hacker News"
author: "Bhupesh Varshney"
published: 2024-02-03T15:39:46.535Z
updated: 2024-05-09T09:28:05.588Z
tags: ["docker", "alpinejs"]
reading_time: 18
upvotes: 8
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How I reduced the size of my very first published docker image by 40% - A lesson in dockerizing shell scripts

**[Hacker News](https://daily.dev/sources/hn)** · [@bhupeshimself](https://daily.dev/bhupeshimself) · 18 min read · 8 upvotes · 0 comments

## Summary

This post describes how the author reduced the size of a Docker image by 40% by using step-by-step optimization techniques, such as multi-stage builds. The author also discusses the use of tools like `docker-slim` and `docker-squash`. The final image size was 17.6 MB.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://bhupesh.me/publishing-my-first-ever-dockerfile-optimization-ugit/>

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#docker](https://daily.dev/tags/docker), [#alpinejs](https://daily.dev/tags/alpinejs)

[View this post on daily.dev](https://daily.dev/posts/how-i-reduced-the-size-of-my-very-first-published-docker-image-by-40---a-lesson-in-dockerizing-shel-iuluj80no)
