forked from jwohlwend/boltz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
92 lines (79 loc) · 3.26 KB
/
Copy pathDockerfile
File metadata and controls
92 lines (79 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# syntax=docker/dockerfile:1.4
FROM nvidia/cuda:12.6.1-cudnn-devel-ubuntu22.04
# Set default RUN shell to /bin/bash
SHELL ["/bin/bash", "-cu"]
# Set environment variables
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# Install basic packages for compiling and building
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \
build-essential \
cmake \
g++-12 \
git \
git-lfs \
curl \
wget \
ca-certificates \
libjpeg-dev \
libpng-dev \
librdmacm1 \
libibverbs1 \
ibverbs-providers \
tzdata \
libgl1-mesa-glx \
libglib2.0-0 \
fontconfig \
&& rm -rf /var/lib/apt/lists/*
# Install Miniconda & use Python 3.11
ARG python=3.10
ENV PYTHON_VERSION=${python}
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/install-conda.sh \
&& chmod +x /tmp/install-conda.sh \
&& bash /tmp/install-conda.sh -b -f -p /usr/local \
&& rm -f /tmp/install-conda.sh \
&& conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main \
&& conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r \
&& conda install -y python=${PYTHON_VERSION} \
&& conda clean -y --all
# Configure conda and pip mirrors for faster installation
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN cat <<EOT >> ~/.condarc
channels:
- defaults
show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
nvidia: https://mirrors.sustech.edu.cn/anaconda-extra/cloud
EOT
# Install Pytorch 2.2
# you can find other versions and installation commands from:
# https://pytorch.org/get-started/previous-versions/
# https://github.com/pytorch/pytorch/wiki/PyTorch-Versions
# RUN pip install --no-cache-dir \
# torch==2.2.1 \
# --extra-index-url https://download.pytorch.org/whl/cu118
ENV TORCH_CUDA_ARCH_LIST="8.0;9.0"
RUN /usr/local/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main \
&& /usr/local/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r \
&& /usr/local/bin/conda tos accept --override-channels --channel https://conda.anaconda.org/pytorch \
&& /usr/local/bin/conda tos accept --override-channels --channel https://conda.anaconda.org/conda-forge
RUN pip install --no-cache-dir \
torch==2.7.1 --index-url https://download.pytorch.org/whl/cu126
COPY . /workspace
RUN pip install --no-cache-dir /workspace[cuda]
WORKDIR /workspace
CMD ["bash"]