Stuck on Docker packaging? Get up to speed quickly

Docker packaging is complex, you don’t understand how it works, and you keep getting stuck:

  • Your docker build just failed—now what?
  • 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?

And yes, you can reverse-engineer how Docker packaging works and figure this all out on your own. You’ll need to combine introductory tutorials, terse StackOverflow answers, and random Google results, but it is possible.

Unfortunately, it will take you days to find and learn everything you need to know. And you’re already busy with the rest of your job; you don’t have time to spare to learn tools the hard way.

You need to learn Docker packaging quickly and effectively.

You’re already busy at work, so how do you learn quickly?

When it comes to learning a new tool, there are three increasing levels of understanding:

  1. You know of the tool’s existence, allowing you to learn more if and when you need to use it.
  2. You can use the tool. You don’t know everything, but you can mostly get your job done.
  3. You’re an expert. You know all the edge cases, bugs, obscure features, and more.

The more you want to learn, the more effort and time you’ll need to invest.

Much of the time, you only need to know how to use Docker; expertise is overkill for tools you only use occasionally. And since you don’t need to become an expert, you can speed up your learning by skipping unnecessary details.

But which details can you skip, and which details are worth learning?

You need to use Docker at your job

Docker is a tool, a means to an end. You need to use it at your job, not write a thesis about it. So you don’t have to memorize every single command, or every single option; that’s what the documentation and online help are for.

But what you do need to understand are the basic abstractions and mechanisms that make it go. Whether it’s debugging a failed build or applying a new Dockerfile command, if you want to package software with Docker you need a good mental model to guide your steps.

Just enough to get you up and running quickly

To help you build that intuitive mental model, and get up to speed quickly, I’ve written a concise, developer-focused book: Just Enough Docker Packaging.

This 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.

You’ll learn just enough about Docker packaging to get up and running quickly, including:

  • The Dockerfile format.
  • The image format.
  • The semantics of naming and tagging images.
  • The image cache.
  • The Docker build process that ties these all together.

And since that’s a lot to cover, and you want to get going as quickly as possible, the book won’t teach you every little detail. Which means you can get through it in an afternoon at work, and then refer back to it as needed.

Just Enough Docker Packaging assumes:

  1. You’re running on a Mac or Linux.
  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

Just Enough Docker Packaging Team edition (10 people)
  • Concise, focused PDF book.
  • Exercises to solidify your understanding.
  • All updates to the 1st edition.
  • 100% money-back guarantee.
  • Help your whole team get up to speed on Docker packaging.
  • Licensed for up to 10 people.
  • 100% money-back guarantee.

Read an excerpt from the book: Learn 10 techniques to help you debug failed Docker builds

What can you do when your docker build errors out, or docker run-ing your new image crashes?

Sign up for my newsletter below, and you’ll get tips and tricks on Docker packaging, Python development and more—and an excerpt from Just Enough Docker Packaging with 10 different techniques you can use to debug your Docker image.

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, Chapters 2 to 7 each have a corresponding exercise to help you practice what you’ve learned.

Ready to learn Docker packaging, quickly and effectively?

Just Enough Docker Packaging Team edition (10 people)
  • Concise, focused PDF book.
  • Exercises to solidify your understanding.
  • All updates to the 1st edition.
  • 100% money-back guarantee.
  • Help your whole team get up to speed on Docker packaging.
  • Licensed for up to 10 people.
  • 100% money-back guarantee.

About me

Hi, I’m Itamar Turner-Trauring.

I’ve been writing Python since 1999, and I first started using Docker in 2014, when I was part of a team that wrote one of the first distributed storage backends for Docker.

I’ve since built Telepresence, a remote development tool for Kubernetes that was adopted as a Cloud Native Computing Foundation sandbox project and has more than 2000 stars on GitHub. I’ve also deployed a number of production Python applications as Docker images.

Over the past year I’ve been researching Docker packaging for Python in production, resulting in a free guide elsewhere on this site, live training classes, a template implementing best practices, and of course this introductory book.