alphafold
alphafold copied to clipboard
reduce docker image size
PR reduces docker image size—a summary of the changes
- Adds
pipefail
to theSHELL
directive for safety - Added
--no-install-recommends
toapt
andautoremove
+clean
as per best practices - Adds
conda clean -afy
to remove cache files, package tarballs, and the entire package cache. To ensure only necessary files are saved in each layer. Ref - Added
--no-cache-dir
to thepip
installs since the pip cache isn't needed for a docker image - Merged the two consecutive
RUN
directives into one - Added quotes around various strings to ensure splitting doesn't occur
Followed rules from hadolint and shellcheck
Running DOCKER_DEFAULT_PLATFORM=linux/amd64 docker build -f docker/Dockerfile -t alphafold . --no-cache
(note the DOCKER_DEFAULT_PLATFORM=linux/amd64
is used because I'm on a M1 MacBook) for the existing Dockerfile
, and and the updated one (with the tag alphafold-new
) here's the difference in size after the changes (9.77GB
vs 12.5GB
)
$ docker images | grep alphafold
alphafold-new latest e823bb581ba2 12 minutes ago 9.77GB
alphafold latest 7ecff97027f2 45 minutes ago 12.5GB
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Thanks for this PR! These suggestions have been included in https://github.com/deepmind/alphafold/releases/tag/v2.2.4