Skip to content

Commit 17afe15

Browse files
Augustin-Zidekcopybara-github
authored andcommitted
Improve AlphaFold 3 Dockerfile
* Use `apt-get` instead of `apt`. Should not make much difference since we set the `--quiet` flag though. * Document better the rationale behind building HMMER from scratch. * Check SHA-256 hash of the downloaded HMMER tar file. * Addresses critique from https://www.linkedin.com/pulse/getting-alphafold-3-run-amd-gpus-owain-kenway-egite/. PiperOrigin-RevId: 763703614 Change-Id: Ibc231b8c31d1d891f537e2765094c1710a76eaea
1 parent e64804c commit 17afe15

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

docker/Dockerfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ FROM nvidia/cuda:12.6.0-base-ubuntu22.04
1616
# git is required for pyproject.toml toolchain's use of CMakeLists.txt.
1717
# gcc, g++, make are required for compiling hmmer and AlphaFold 3 libaries.
1818
# zlib is a required dependency of AlphaFold 3.
19-
RUN apt update --quiet \
20-
&& apt install --yes --quiet software-properties-common \
21-
&& apt install --yes --quiet git wget gcc g++ make zlib1g-dev zstd
19+
RUN apt-get update --quiet \
20+
&& apt-get install --yes --quiet software-properties-common \
21+
&& apt-get install --yes --quiet git wget gcc g++ make zlib1g-dev zstd
2222

2323
# Get apt repository of specific Python versions. Then install Python. Tell APT
2424
# this isn't an interactive TTY to avoid timezone prompt when installing.
2525
RUN add-apt-repository ppa:deadsnakes/ppa \
26-
&& DEBIAN_FRONTEND=noninteractive apt install --yes --quiet python3.11 python3-pip python3.11-venv python3.11-dev
26+
&& DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet python3.11 python3-pip python3.11-venv python3.11-dev
2727
RUN python3.11 -m venv /alphafold3_venv
2828
ENV PATH="/hmmer/bin:/alphafold3_venv/bin:$PATH"
2929
# Update pip to the latest version. Not necessary in Docker, but good to do when
@@ -32,10 +32,14 @@ ENV PATH="/hmmer/bin:/alphafold3_venv/bin:$PATH"
3232
RUN pip3 install --upgrade pip
3333

3434
# Install HMMER. Do so before copying the source code, so that docker can cache
35-
# the image layer containing HMMER. Alternatively, you could also install it
36-
# using `apt-get install hmmer` instead of bulding it from source.
35+
# the image layer containing HMMER. Alternatively, you could also install it
36+
# using `apt-get install hmmer` instead of bulding it from source, but we want
37+
# to have control over the exact version of HMMER. Also note that eddylab.org
38+
# unfortunately doesn't support HTTPS and the tar file published on GitHub is
39+
# is explicitly not recommended to be used for building from source.
3740
RUN mkdir /hmmer_build /hmmer ; \
3841
wget http://eddylab.org/software/hmmer/hmmer-3.4.tar.gz --directory-prefix /hmmer_build ; \
42+
(cd /hmmer_build && echo "ca70d94fd0cf271bd7063423aabb116d42de533117343a9b27a65c17ff06fbf3 hmmer-3.4.tar.gz" | sha256sum --check) && \
3943
(cd /hmmer_build && tar zxf hmmer-3.4.tar.gz && rm hmmer-3.4.tar.gz) ; \
4044
(cd /hmmer_build/hmmer-3.4 && ./configure --prefix /hmmer) ; \
4145
(cd /hmmer_build/hmmer-3.4 && make -j) ; \

0 commit comments

Comments
 (0)