A multi-layer image spreads filesystem data across several image layers so Docker Engine can transfer layers concurrently. Splitting large files can improve pulls on new machines and auto-scaling container platforms. section 17.4
Use the approach when transfer speed matters, while accounting for its trade-offs:
- Copy each large data file into its own layer instead of copying all files through one pattern. section 17.4
- Expect more brittle Dockerfiles because every file must be listed explicitly. section 17.4
- Remember that Docker downloads three layers concurrently by default, with the Engine configuration able to change that limit. section 17.4
Compare one layer with many layers
Build both targets with `docker build -t diamol/ch17-ml-dataset:v4-one-layer -f Dockerfile.v4 --target one-layer .` and `docker build -t diamol/ch17-ml-dataset:v4-multi-layer -f Dockerfile.v4 --target multi-layer .`, then inspect them using `docker history`.
