Card 07/ 07

RecapDifficulty: Advanced1 min

What You Learned

  • Each instruction leaves a layer, and a layer is the unit of both caching and disk.
  • The cache is a chain: once a layer changes, everything below it runs again.
  • Copy the manifest, install, then copy the source, so an edit cannot invalidate the install.
  • docker system df says what is reclaimable, and the build cache is usually most of it.
  • prune --volumes is the dangerous one, because a stopped database's data looks unused.