1- FROM ubuntu:22.04
1+ FROM nvidia/cuda:12.4.0-devel-ubuntu22.04
2+
3+ # Set environment variable
24ENV DEBIAN_FRONTEND=noninteractive
35ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
46ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64
5- ENV PATH=/usr/local/cuda/bin:${PATH}
6- ENV PATH=/root/miniconda3/bin:${PATH}
7- # ENV http_proxy=http://your_proxy_here \
8- # https_proxy=http://your_proxy_here
7+ ENV PATH=/usr/local/cuda/bin:/root/miniconda3/bin:${PATH}
98
10- WORKDIR /root/
9+ # Copy the configuration file
10+ COPY env/apt /etc/apt
11+ COPY . /root/MMTrustEval
1112
12- COPY ./env/sources.list /etc/apt/sources.list
13- COPY ./env/requirements.txt /root/requirements.txt
13+ WORKDIR /root/MMTrustEval
1414
1515SHELL ["/bin/bash" , "--login" , "-c" ]
1616
17+ # System package installation and basic configuration
1718RUN apt-get clean all \
19+ && rm -rf /var/lib/apt/lists/* \
1820 && apt-get update -y \
19- && apt-get install -y apt-utils rsync openssh-server inetutils-ping wget curl sudo git zip unzip vim \
20- && apt-get install -y libgl1 gcc g++ build-essential pkg-config libssl-dev \
21- && /etc/init.d/ssh start \
21+ && apt-get install -y --no-install-recommends \
22+ apt-utils \
23+ rsync \
24+ openssh-server \
25+ inetutils-ping \
26+ wget \
27+ curl \
28+ sudo \
29+ git \
30+ zip \
31+ unzip \
32+ vim \
33+ libgl1 \
34+ gcc \
35+ g++ \
36+ build-essential \
37+ pkg-config \
38+ libssl-dev \
39+ ca-certificates \
40+ python3.9 \
41+ && rm -rf /var/lib/apt/lists/*
42+
43+ # SSH configuration
44+ RUN /etc/init.d/ssh start \
2245 && echo "PermitRootLogin yes" >> /etc/ssh/sshd_config \
2346 && echo 'root:123456' | chpasswd \
24- && service ssh restart \
25- && mkdir -p ~/miniconda3 \
26- && wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /root/miniconda3/miniconda.sh \
27- && bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 \
28- && rm -rf ~/miniconda3/miniconda. sh \
29- && /root/miniconda3/ bin/conda init bash \
30- && curl https://sh.rustup.rs -sSf | sh -s -- -y \
31- && bash -l -c " source /root/.bashrc" \
32- && conda install python=3.9 -y \
33- && wget https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run -O /root/cuda.run \
34- && bash /root/cuda.run --silent --toolkit --override \
35- && rm -f /root/cuda.run \
36- && pip install -r /root/requirements.txt
37-
38- # for ssh login
39- EXPOSE 22
40- # for mkdocs service
41- EXPOSE 8000
47+ && service ssh restart
48+
49+
50+ # UV
51+ RUN wget -qO- https://astral.sh/uv/install.sh | sh \
52+ && source $HOME/.local/ bin/env \
53+ && uv venv --python 3.9 \
54+ && source .venv/bin/activate \
55+ && uv pip install setuptools \
56+ && uv pip install torch==2.3.0 \
57+ && uv pip sync --no-build-isolation ./env/requirements.txt
58+
59+
60+ # Port
61+ EXPOSE 22 8000
62+
63+ # SSH
64+ CMD [ "/usr/sbin/sshd" , "-D" ]
0 commit comments