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, You’ve probably noticed this by now: LLM prototypes are easy to build. But as soon as you try to turn them into actual production LLM systems… a lot more goes into it. In this week’s video, I walk through how to structure AI agents in Python using design patterns like Chain of Responsibility, Observer, and Strategy. I’ll build a fully functional travel assistant using Pydantic AI and explore how to make your agent pipelines more maintainable, testable, and modular. Hope you enjoy...

Hi there, I have to admit, I often forget how powerful the Python standard library is. Whenever I'm working on some project, I have to remind myself to consider whether something I need is already there, ready for me to use. So, in this week’s video, I’m looking at 10 of the most useful and underrated modules in Python’s standard library, including pathlib, heapq, graphlib, and more. These tools can help you write cleaner, faster, and more maintainable code without adding a single dependency....

Hi there, If you’ve been experimenting with trying to integrate AI into your code, you’ve probably run into the same problem I have: unstructured, unpredictable output. And the other way around: how do you let AI agents interact with your own code? That’s where Pydantic AI comes in. In this week's video, I show how to use Pydantic AI to embed an LLM agent directly into your Python app: with structured input, validated output, and access to real business logic. What I love about this approach...