My journey using Docker as a development tool
2022-07-13 , Wicklow Hall 1

I have been programming in Python for 5 years and almost from day one I've been using Docker with Python. Docker is now a widely used tool across the industry, due to its flexibility. It can be used as a tool to help deploy your code in production, say using Kubernetes. It can also be used as a tool to help develop code locally, with tools such as docker-compose.

It has taken me some time to discover various features and best practices when using Docker. Especially when it comes to using it for local development.

In this talk, I would like to go over a journey I have taken with Docker whilst working with it over several years. Starting from a single build step with a full-fat image, going over multi-stage Docker images. Showing you how you can use the same Dockerfile for development and production.


Docker is a prevalent tool in our industry today, it is widely used for several proposes. In this talk, I would like to describe the journey I have taken with Docker and how I have learnt to use it with Python for local development. The talk will mostly focus on how we can use Docker to run all of our development tasks, so we hardly need to have anything installed locally. To the point where you can work on almost any project with nothing more than an editor, your terminal and Docker.

We will look at how we can take a simple FastAPI web service and dockerise it. The talk will be a step by step guide, starting of with a simple Docker image and improving it iteratively.

  • Firstly use a simple Docker image
  • Then add docker-compose to dockerise its dependencies such as database
  • Then see how we can run tests (and other tasks) directly in our Docker container
  • How to use this with Github Action
  • Then look at multistage builds
  • Then split this into development and production image
  • How can we handle git dependencies that require an SSH key to be injected into the Docker image at build time

I’d be a little more specific. Like, how we handle private pip packages in our docker images. This talk is for you if you are a casual user of Docker and know a few of its features but want to improve your Docker skills.

This is NOT a talk for you if you are an expert in Docker and know most of its features.

Code: https://gitlab.com/haseeb-slides/docker-as-a-dev-tool
Slides: https://docker-as-a-dev-tool.haseebmajid.dev


Abstract as a tweet:

In this talk, I would like to describe the journey I have taken with Docker and how I have learnt to use it with Python for local development.

Expected audience expertise: Python:

some

Expected audience expertise: Domain:

none

I am software engineer with around 5 years of professional experience. I am currently working for ZOE, a start-up in the healthcare space. Most of my experience is writing backend web services, using Python. I also extensive experience with Docker, Git and Linux.