关键是要 build 一个最省空间的 image,以及有一个清晰定义的 Dockerfile。
- Don't install build tools without good reason
- Don't leave temporary files lying around
- Clean up after the package manager
- Pin package versions
- Combine commands
- Use environment variables to avoid repeating yourself