You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ubuntu-based image, powered by eclipse-temurin:11-jre-noble, was 1.3 GB,
unnecessarily large for a Jupyter notebook environment. Debian base
includes many unnecessary packages, apt cache bloat, and no aggressive
Python artifact cleanup.
Fix:
- Migrate from Ubuntu to Alpine Linux 3.22 (musl-based, 5.4MB base)
- Multi-architecture support (linux/amd64, linux/arm64) via BuildKit
TARGETARCH
- Aggressive Python optimization:
* Remove __pycache__, *.pyc, *.pyo files
* Strip Babel locale data (31.4MB → 640KB, keeping only en_*)
* Remove test directories and pip/setuptools from site-packages
- Virtual build dependencies pattern (gcc/g++/musl-dev cleaned after
Jupyter install)
- Move curl to intermediate-builder stage only (not in final image)
- Optimize COPY with --chown to eliminate extra chown layer
- Architecture-specific coursier binaries:
* amd64: Official musl static build (v2.1.24)
* arm64: VirtusLab glibc build (v2.1.24) with gcompat layer
- Enhanced .dockerignore to exclude dev artifacts
Results:
- Image size: 1.305GB → 549.8MB (57.9% reduction)
- Architecture: linux/amd64, linux/arm64 validated
- Functionality: All notebooks work, GraphViz rendering verified
Known limitations:
- Jupyter authentication disabled (intentional for local dev, see
source/jupyter_server_config.py)
- Python 3.12 paths hardcoded (will need update on Alpine Python updates)
- Scala 2.12.10 + Almond 0.9.1 (newer versions require source changes per
patch)
0 commit comments