---
title: "💭 Episode #323 Best practices for Docker in production - [Talk P..."
description: "!https://talkpython.fm/episodes/show/323/best-practices-for-docker-in-production"
date: 2024-06-16
published: true
tags:
  - python
  - docker
  - thought
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://talkpython.fm/episodes/show/323/best-practices-for-docker-in-production" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-image">
      <img src="https://cdn-podcast.talkpython.fm/episodes/youtube_image/yDend6I9nwE/best-practices-for-docker-in-production.jpg?v=1" alt="Best practices for Docker in production — You" loading="lazy">
    </div>
    <div class="embed-card-content">
      <div class="embed-card-title">Best practices for Docker in production</div>
      <div class="embed-card-description">You</div>
      <div class="embed-card-meta">talkpython.fm</div>
    </div>
  </a>
</div>


Great listen for anyone interested in productionizing python code with docker.  Itamar brings up some 


Don't trust base images for security, upgrade your packages.  Vulnerabilties become published and solved giving the bad guys istructions how to wreck your day and these fixes wont come to your docker application for up to two weeks due to image build tatency.

For job based containers pre-compile your pyc for faster startup.

Alpine linux is probably not what you want for python.  Many packages such as postgres ship pre-copiled binaries that work for most linux distributions wich use glibc, but alpine uses musl so the binaries will be incompatable requiring you to need to install a bunch of build dependencies.

!!! note

    This post is a <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
