Optimize Dockerfiles for all Docker images #680
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.
This commit optimizes the Dockerfiles for both Oracle and Ubuntu Docker images to enhance efficiency, reduce image size, and ensure adherence to best practices.
Consolidate
RUN
commands: This reduces Docker image layers and allows effective cleanup within the same layer.Standardize on apt-get over apt: apt is designed for interactive use, while apt-get provides a stable CLI interface for scripting. This change ensures script stability and consistency in Dockerfiles.
Adjust package installation: Use
--no-install-recommends
withapt-get install
to avoid unnecessary packages and explicitly installca-certificates
in Ubuntu Docker images forwget
to function correctly with HTTPS.Remove temporary installation files: Further reduces Docker image size by cleaning up unused files post-installation.
These changes overall streamline the Dockerfiles, leading to more efficient and smaller Docker images.
Here's the result of the optimization, which is significant: