~/talk

10x smaller docker containers for Data Science

Talkat PyData Eindhoven 2020 · 2020-10-07..10-09· [python, devops-and-delivery]
links:none on file
slides:none on file

Starts from a 1.7 GB baseline and actually reduces a PyData image with Matplotlib Scipy Numpy and Scikit-learn down to ~188 MB using concrete steps: use python3.8-slim, add a .dockerignore, inspect layers with dive and docker history, collapse RUNs to minimize layers, use multi-stage builds, build wheels with pip wheel and repair with auditwheel, set CFLAGS to strip debug info. Result is ~9–10× smaller but much slower to build (59 minutes vs ~5) and more complex to maintain.

AI-written summary · about

  1. 0:00Introduction
  2. 1:07Minimal Docker images
  3. 3:16Docker ignore files
  4. 5:23Image size with Docker history
  5. 6:03Python slim base images
  6. 7:32Dive tool for layers
  7. 10:22Unnecessary files removal
  8. 12:28Minimizing layers
  9. 13:54Squashing layers
  10. 14:15Alpine Linux base
  11. 16:25Python wheels compatibility
  12. 19:33Compiling Alpine packages
  13. 21:40Removing build dependencies
  14. 22:23Multi-stage builds
  15. 23:47Fixing wheels with auditwheel
  16. 25:37Compiler flags optimization
  17. 27:02Duplicate libraries removal
  18. 28:24Size vs build efficiency
  19. 29:06Key takeaways
  20. 30:09Q&A
~/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.