[talk] - further docker image size reduction #61
+3
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before
After
npm cache clean --force
: This command clears the npm package cache. The npm package cache can accumulate over time as you install various packages. Cleaning the cache helps to remove unnecessary files, which can save space in the final image.rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* /usr/share/doc/*
: This command removes various temporary and cache files from the system. Let's break down each part:/tmp/*
: Deletes files from the system's temporary directory. Temporary files can take up space, and removing them is a common practice to keep the image size smaller./var/lib/apt/lists/*
: Deletes package lists retrieved during the package installation process. These lists can take up space and are not necessary in the final image./var/tmp/*
: Removes temporary files from another temporary directory./usr/share/doc/*
: Deletes documentation files for installed packages. While documentation is useful, it's often not required in the final image, especially for production use cases.By including these commands in your Dockerfile, you're effectively cleaning up various temporary and unnecessary files, which helps in reducing the size of the final Docker image. This can be particularly important in production environments where smaller image sizes contribute to faster deployment times and reduced resource consumption.