Building Effective Docker Images: Python Edition

datawookie


5

Votes

Description:

Docker is a cornerstone of modern software development and deployment, ensuring reproducibility, scalability, and seamless environment management across diverse platforms. Explore the art and science of crafting efficient and optimised Docker images specifically tailored for Python applications.

What

Docker has revolutionised how we develop, deploy, and run applications by offering a lightweight, portable solution for application containerisation. For the Python community, Docker presents an vital tool for addressing common challenges such as "it works on my machine", dependency management, and consistent environments across development and production systems. However, creating effective Docker images that are optimised for Python applications requires a nuanced understanding of both Docker and Python ecosystems. This tutorial aims to bridge that gap, providing attendees with the knowledge to build Docker images that are not only functional but also optimised for performance, size, and security.

Who

This presentation is designed for a broad audience, including Python developers, DevOps engineers, and anyone with a basic understanding of Docker and Python. Whether you're new to Docker or looking to refine your existing containerisation skills, this talk will offer insights and techniques to enhance your workflow.

Type

A hands-on, example-driven session that focuses on real-world applications and best practices. It aims to demystify Docker image optimisation for Python applications without overwhelming attendees with unnecessary jargon or complexity.

Takeaway

Participants will walk away with a solid understanding of:

  • Key considerations for building Docker images for Python applications, including base image selection, managing dependencies, and leveraging Dockerfile instructions efficiently.
  • Strategies for minimising Docker image sizes without sacrificing functionality or performance, utilising multi-stage builds, and optimising layer caching.
  • Techniques for enhancing the security of Docker images, including the use of non-root users, handling sensitive data, and scanning images for vulnerabilities.
  • Best practices for debugging and maintaining Python Docker images, ensuring they remain lightweight, secure, and easy to update over time.

Participants will leave equipped with the knowledge, tools and confidence to build lighter, faster, and more secure Docker images, enhancing their Python projects' development lifecycle and deployment efficiency.

Prerequisites:

Participants should be familiar with Python programming. No prior Docker experience is necessary but some familiarity with the concepts behind containers would be helpful (although it will be covered in the introduction).

Video URL:

I have not yet prepared a video but will happily do so if required. I do, however, have a talk from the satRday conference in London last year: https://www.youtube.com/watch?v=dFfFiq8eOls.

Content URLs:

I don't currently have any links to this session because I have not completed all of the content. You can, however, take a look at my blog (https://datawookie.dev/blog/) to see that I do regularly write about technical topics.

Speaker Info:

I'm Lead Data Scientist for Fathom Data, a consulting company based in South Africa. I work mainly with Python, R, SQL and Docker.

I have been speaking for a number of years and have given talks and workshops at quite a few meetups and conferences.

Speaker Links:

https://datawookie.dev/blog/ https://stackoverflow.com/users/1815577/datawookie https://github.com/datawookie

Section: Python in Platform Engineering and Developer Operations
Type: Workshops
Target Audience: Intermediate
Last Updated: