~/talk

Speeding up Your Docker Image Build

Talkat PyConline AU 2020 · 2020-09-04..09-06· [devops-and-delivery]
links:none on file
slides:none on file

Five concrete tactics: avoid rebuilds when possible, reorder Dockerfile into an inverted pyramid so big slow layers stay low, and copy only requirements.txt before pip install to keep cache hits. Reduce downloads with apt --no-install-recommends and split dev deps, then enable BuildKit with DOCKER_BUILDKIT=1 and use --mount=type=cache for pip/apt caches. Demonstrations show cache mounts and commands and report converting 10–15 minute rebuilds into minute-scale iterations.

AI-written summary · about

  1. 0:00Speeding up Your Docker Image Build
  2. 1:48My goal: to help you reclaim days of your time.
  3. 3:20Context switching. Busy waiting. Slow feedback loops.
  4. 3:515 tips to speed up your Docker image builds!
  5. 4:16You don't have to use Docker everywhere.
  6. 4:38First step towards automation Executable documentation
  7. 6:22Structure your Dockerfile instructions like an inverted pyramid.
  8. 6:41Docker image layers are friends! They can be cached and reused.
  9. 8:23Only copy files which are needed for the next step.
  10. 8:36Dockerfile snippet
  11. 10:00We're reusing layers... But downloading packages takes a while.
  12. 10:27Download less stuff.
  13. 11:36Use BuildKit with the new cache mount feature.
  14. 14:15You can (and should) measure where your bottlenecks are.
  15. 17:59Soon: CPU & memory are the new bottleneck...
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.