How to Make Your Python Docker Image 400% Smaller | Issue #44


Hi there,

If your Docker builds are taking forever, your images are probably bloated with unnecessary dependencies. In this week’s video, I break down how to optimize your Dockerfiles step by step. 🐋

I cover better base images, BuildKit, multi-stage builds, and smarter dependency management—all to make your builds faster and leaner.

Plus, I ran into a weird Docker issue I still haven’t figured out. Watch today’s video and speed up your builds! 🎥

Cheers,

Arjan

# News

Happy Pi Day! 🐍🥧

Besides being my favorite day of the week, this Friday is extra special—it’s Pi Day! 🎉 To celebrate, all ArjanCodes courses are available at a 14.3% discount this week if you use coupon PITHON2025.

This is your chance to sharpen your skills, elevate your career, and write exceptional software. But unlike π, this offer isn’t infinite—it ends tonight at midnight!

🚀 Check out the courses here!

Terminal Colours Are Tricky

Why do some terminals display colors perfectly while others turn your CLI into a rainbow mess?

Julia Evans breaks it all down in this great article on how terminal colors actually work—ANSI codes, 256-color palettes, and all the quirks in between.

If you build CLI tools or just love a well-themed terminal, this is a must-read. 👉 Check it out here.

# Community

NASA has insanely strict coding rules for safety-critical software. No dynamic memory allocation after initialization, no functions longer than 60 lines, and at least two runtime assertions per function. Sounds extreme, right? But when your software is flying through space, there’s no room for errors. 🚀

This sparked a great discussion in the ArjanCodes Discord about fail-fast principles, defensive programming, and whether these rules make sense for everyday coding. Should we adopt some of NASA’s practices, or are they overkill?

👉 Join the conversation and share your thoughts! to join the thread and open Dale’s handy playlist.


Do you enjoy my content on YouTube and would you like to dive in deeper? Check out my online courses below. They've helped thousands of developers take the next step in their careers.

🚀 The Mindset Online Course Series

The goal of this series is to help junior developers grow their skills to become senior developers faster.

💥 Other Courses

💡 If you’re part of a development team at a company, I offer special packages for companies that give your team the tools to consistently write high-quality code and dramatically increase your team's productivity.

Unsubscribe | Send by ArjanCodes

Jan van Eijklaan 2-4, Bilthoven, UT 3723 BC

The Friday Loop

Every Friday, you'll get a recap of the most important and exciting Python and coding news. The Friday Loop also keeps everyone posted on new ArjanCodes courses and any limited offers coming up.

Read more from The Friday Loop

Hi there, If you’ve ever used Python decorators, you know they look like a clean way to add functionality. But have you ever struggled to debug a decorated function? Or wondered why your type hints suddenly break? Or spent way too much time figuring out why your decorators aren’t working as expected? 🫠 🚨 Decorators introduce hidden complexity that can turn your code into a nightmare. And honestly? I think they’re overused. In this week’s video, I explain: Why decorators break type safety and...

Hi there, Ever looked at your old code and felt secondhand embarrassment? Yeah, me too. Keeping your code simple and maintainable is an art. In today’s video, I break down 10 essential tips that will help you write cleaner, more efficient Python code. 🚀 Some key takeaways: 🛑 Stop overengineering—simple solutions are often the best. ✂️ Cut the copy-paste habit—DRY code is maintainable code. 🧹 Refactor before your code turns into a horror movie. Happy coding! 🐍 Cheers, Arjan # News How Do...

Hi there, Have you ever hesitated before hitting git merge or git rebase because… well, who actually understands Git? 🤯 Good news! In this week’s video, I walk through a real-world FastAPI project and show exactly how to merge, fast-forward, and rebase—step by step. No fluff, just practical Git skills you’ll actually use. Plus, I’m sharing some advanced Git tricks to make your workflow smoother. Happy coding and enjoy the video! Cheers, Arjan # News Build TUI Apps with Python’s Textual Ever...