Learn the fundamentals of Docker packaging—in just one afternoon

There are many technologies you need to learn as a Python programmer, and Docker is just one more item on an ever-expanding list. So when you’ve used it before, you’ve copy/pasted enough docker run and docker-compose commands to get things going, and then moved on.

But now you need to start packaging your application, which means doing everything from writing Dockerfiles to debugging broken builds—and your basic knowledge isn’t enough.

  • How do you debug a docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"flask\": executable file not found in $PATH": unknown.?
  • Why are you wasting time re-running pip install, downloading and re-installing every single package, every single time?
  • Why are you getting a connection reset error when you try to point your browser at your Dockerized application?

You need to actually understand how Docker packaging works, and quickly; you’ve still got plenty of other work to do. All those bugs in the issue tracker won’t just fix themselves, nor will the features ship themselves—but first, you need to figure out how Docker works.

Become more productive–fast

Right now Docker is a stumbling block. But for those who understand how it works, Docker is a useful enough tool that it’s become ubiquitous.

That means applying Docker packaging will help you become more productive now, and it’s a skill that will make you more employable in the future. And since it’s going to make you more effective at your job, wouldn’t it be great to learn it on the job, and quickly?

Learn Docker packaging in an afternoon

Just Enough Docker Packaging book cover

To help you learn the fundamentals of Docker packaging, I’ve written a concise, practical, book specifically for Python developers: Just Enough Docker Packaging. The book is:

  • Created for learning: It’s based on the training materials I use to teach live classes.
  • For Python developers: All the examples use Python.
  • Short and focused: You’ll learn how Docker packaging works so you can package your application, and how to debug your build when things go wrong. You should be able to read the whole book in one afternoon.
  • Up-to-date: Updated throughout to use BuildKit mode and match the latest Docker 23.0.

The book will show you how Docker packaging actually works, with shell transcripts, plenty of examples, conceptual diagrams, and exercises to help you practice what you’ve learned. Occasionally I’ll even make a mistake, so you can see how I recover.

What readers are saying:

The debugging section was super useful, in its entirety. Besides that, the overall or high-level concepts and how you presented them visually really helped.

I have been using Docker for 2 years maybe, as a developer, and I understood the mechanics, but I did not have time to really think about the details or understand how the images were composed.

The book was really useful to me. I am grateful to you for putting this together.

—Pablo Oliva

Just Enough Docker Packaging assumes:

  1. You’re running on a Mac or Linux (WSL2 on Windows might work too).
  2. You have some familiarity with command-line tools and the Unix shell.
  3. You have a minimal understanding of Python packaging.
  4. Minimal to zero previous knowledge of Docker.

Ready to learn Docker packaging, quickly and effectively?

What readers are saying:

“Thank you. Your book really helped. I’ve been working with Docker for a few years now and I found the debugging techniques - especially copying files in and out of the container - to be really interesting and immediately useful. I didn’t know these capabilities existed.

I would definitely recommend the book to a colleague if they were trying to get started with Docker or improve their knowledge.

—Alexander Kammerer, Investment Engineer


“Previously I had very limited experience with Docker. Exactly as you’d advertised, within a few hours I felt I had a good grasp of the fundamentals and could get back to regular work.”

—Albert S., Scientific Software Developer


Bundle #1: Just the book (US$29)

Includes Just Enough Docker Packaging:

  • Learn the basics of Docker packaging.
  • Concise, focused PDF book, updated March 2023 to match Docker 23.0.
  • Exercises to solidify your understanding.
  • All updates to the 1st edition.
  • 100% money-back guarantee.
Buy the book for US$29

Note: I prefer not to take money from teams working on projects for (A) the military, surveillance, or national security (B) prisons or police, (C) fossil fuel extraction or blockchain. If any of these categories apply to you, please don’t purchase this product.

5% of sales in 2024 will donated to UNRWA.

Separately, if you live in a low-income country, email me about purchasing price parity (PPP) discounts.


Bundle #2: Learn production best practices (US$89)

Includes:

Take the next step and learn how to package your Python application for production. The handbook will:

  • Teach you a clear, step-by-step iterative process to packaging your application with Docker, starting with the most important parts like security, and ending with optimizations like build time and image size.
  • Recommend specific best practices for each step in the process.
  • Provide a reference covering over 70 best practices, with examples and links to further reading.
  • Respect your limited time. A concise summary, the Handbook includes ~120 pages of to-the-point information.
  • All updates to the 1st edition, delivered by email.
  • 100% money-back guarantee.

What readers of the Production Handbook are saying:

Tweet from @henrik_pw: I have bought it and I think it was worth every penny. There is so much to think about so it is nice to have a reference to work from.

Buy the book + Production Handbook for US$89

Note: I prefer not to take money from teams working on projects for (A) the military, surveillance, or national security (B) prisons or police, (C) fossil fuel extraction or blockchain. If any of these categories apply to you, please don’t purchase this product.

5% of sales in 2024 will donated to UNRWA.

Separately, if you live in a low-income country, email me about purchasing price parity (PPP) discounts.

Still not sure?

Read my article on how to decide whether to buy a product, and how to convince your boss to pay for it.


What’s in the book

Chapter by chapter, Just Enough Docker Packaging covers:

  1. Images and containers: what they are and how to use them.
  2. Minimal packaging: your first Docker image for a simple Python application, and the basics of Dockerfile commands.
  3. Docker networking and its impact on packaging: configuring servers, and finding addresses as client software via environment variables and well-known hostnames.
  4. Configuring your application for Docker packaging: persistent data, logging, volumes, command-line parsing.
  5. Sharing images: pulling and pushing, image registries, and understanding image naming.
  6. Smaller and faster builds: build caching, image as layers, skipping files with .dockerignore.
  7. Debugging your build: how to debug failed builds, and containers that won’t start.
  8. Next steps: what to learn next.

The best way to learn from this book is to type along as you read it, running the same commands on your computer. Additionally, most chapters have corresponding exercises to help you practice what you’ve learned.

Changelog

March 2023

  • Updated all output examples to assume BuildKit is on by default.
  • Switched all examples from Python 3.7 to Python 3.11.
  • Switched from the deprecated centos image to almalinux:9.
  • Minor updates and improvements throughout.

December 2020

  • Updated the debugging chapter to work with BuildKit, which is enabled by default on newer installs of Docker Desktop on Windows and macOS.
  • Discussed the need for --progress=plain when using BuildKit.

November 2020

  • Additional tweaks and improvements based on live training classes.
  • Additional exercises are included.

April 2020

  • Expanded the debugging chapter with a new section on extracting files from a failed build.
  • Clarified that --bind 0.0.0.0 and the port number used in portforwarding are specific to the server used, rather than Docker features.
  • Other small improvements.

January 2020

The original release of the book.

Ready to learn Docker packaging, quickly and effectively?


Bundle #1: Just the book (US$29)

Includes Just Enough Docker Packaging:

  • Learn the basics of Docker packaging.
  • Concise, focused PDF book, updated March 2023 to match Docker 23.0.
  • Exercises to solidify your understanding.
  • All updates to the 1st edition.
  • 100% money-back guarantee.
Buy the book for US$29

Note: I prefer not to take money from teams working on projects for (A) the military, surveillance, or national security (B) prisons or police, (C) fossil fuel extraction or blockchain. If any of these categories apply to you, please don’t purchase this product.

5% of sales in 2024 will donated to UNRWA.

Separately, if you live in a low-income country, email me about purchasing price parity (PPP) discounts.


Bundle #2: Learn production best practices (US$89)

Includes:

Take the next step and learn how to package your Python application for production. The handbook will:

  • Teach you a clear, step-by-step iterative process to packaging your application with Docker, starting with the most important parts like security, and ending with optimizations like build time and image size.
  • Recommend specific best practices for each step in the process.
  • Provide a reference covering over 70 best practices, with examples and links to further reading.
  • Respect your limited time. A concise summary, the Handbook includes ~120 pages of to-the-point information.
  • All updates to the 1st edition, delivered by email.
  • 100% money-back guarantee.

What readers of the Production Handbook are saying:

Tweet from @henrik_pw: I have bought it and I think it was worth every penny. There is so much to think about so it is nice to have a reference to work from.

Buy the book + Production Handbook for US$89

Note: I prefer not to take money from teams working on projects for (A) the military, surveillance, or national security (B) prisons or police, (C) fossil fuel extraction or blockchain. If any of these categories apply to you, please don’t purchase this product.

5% of sales in 2024 will donated to UNRWA.

Separately, if you live in a low-income country, email me about purchasing price parity (PPP) discounts.

Still not sure?

Read my article on how to decide whether to buy a product, and how to convince your boss to pay for it.