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

Wolvenplein 25, Utrecht, UT 3512 CK

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, This week’s video is all about uv workspaces, and why they’ve completely changed the way I manage Python projects. In the video, I walk you through a real-world example: I build a CLI tool and a FastAPI API that both fetch and summarize news headlines using OpenAI. But the real lesson is in how the project is structured. I show you how to share a local package between apps, define common dependencies like openai or httpx only once. And you can manage everything using uv’s workspace...

Hi there, When I see an if-statement with multiple elifs in my code, it almost always triggers an investigation. Is there some way to rewrite this to make the logic simpler? Is there a chance that in the future I'll need to add even more complexity? If so, I'll try to redesign the code so that I don't need that chain of if-elif statements. In this week’s video, I cover a design pattern that helped me eliminate many of those chains from a project + at the same time made the code easier to...

Hi there, I just published a new video about Python 3.14, and no, it’s not just about the version number lining up with π (though that does make me feel more complete). The new release brings a bunch of improvements, but I decided to focus on the features I personally love and that I actually use in my day-to-day work. Here’s what I cover in the video: A small but beautiful improvement to exception syntax (fewer parentheses!) Native Zstandard compression with way better performance than gzip...