Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce docker image size #526

Closed
wants to merge 1 commit into from

Conversation

TheDen
Copy link

@TheDen TheDen commented Jul 6, 2022

PR reduces docker image size—a summary of the changes

  • Adds pipefail to the SHELL directive for safety
  • Added --no-install-recommends to apt and autoremove+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 the pip 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

@google-cla
Copy link

google-cla bot commented Jul 6, 2022

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.

@Htomlinson14
Copy link
Collaborator

Thanks for this PR! These suggestions have been included in https://github.com/deepmind/alphafold/releases/tag/v2.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants