summaryrefslogtreecommitdiff
path: root/doc/ci/pipelines/pipeline_efficiency.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ci/pipelines/pipeline_efficiency.md')
-rw-r--r--doc/ci/pipelines/pipeline_efficiency.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/ci/pipelines/pipeline_efficiency.md b/doc/ci/pipelines/pipeline_efficiency.md
index c4febba8f44..149c596430c 100644
--- a/doc/ci/pipelines/pipeline_efficiency.md
+++ b/doc/ci/pipelines/pipeline_efficiency.md
@@ -222,6 +222,8 @@ Methods to reduce Docker image size:
- Create a dedicated development image.
- Disable man pages and docs installed by packages to save space.
- Reduce the `RUN` layers and combine software installation steps.
+- Use [multi-stage builds](https://blog.alexellis.io/mutli-stage-docker-builds/)
+ to merge multiple Dockerfiles that use the builder pattern into one Dockerfile, which can reduce image size.
- If using `apt`, add `--no-install-recommends` to avoid unnecessary packages.
- Clean up caches and files that are no longer needed at the end. For example
`rm -rf /var/lib/apt/lists/*` for Debian and Ubuntu, or `yum clean all` for RHEL and CentOS.