Skip to content

Containers

Images, layers, the build cache, volumes, networking and users — and how to build a small image that stops cleanly.

10 lessons · about 80 minutes

What you'll go through

  • 01It works on my machine, and that stopped being funny8 min
  • 02Your container is a process, not a small computer8 min
  • 03Why the image is 1.2 GB and the application is 12 MB8 min
  • 04The same build takes four seconds or four minutes8 min
  • 05Ctrl-C does nothing and the container takes ten seconds to die8 min
  • 06You restarted the container and the database is empty8 min
  • 07localhost inside the container is not your localhost8 min
  • 08The secret you removed is still in the image8 min
  • 09Everything runs as root, including the mistake8 min
  • 10From 1.2 GB to 80 MB without breaking anything8 min