-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (27 loc) · 970 Bytes
/
Dockerfile
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
FROM nvidia/cuda:12.2.2-runtime-ubuntu22.04 AS gdfx2
WORKDIR /home/gdfx2
# python installation
RUN apt update && apt install -y \
python3 \
python3-pip \
python3-venv \
&& apt autoremove \
&& apt clean
# python environment
RUN python3 -m venv /home/gdfx2/venv
RUN . /home/gdfx2/venv/bin/activate && pip3 install \
torch \
torchvision \
torchaudio \
&& deactivate
# create entrypoint
RUN echo "#!/bin/bash">/home/gdfx2/gdfx2.sh
RUN echo ". /home/gdfx2/venv/bin/activate">>/home/gdfx2/gdfx2.sh
RUN echo "python3 -u /home/gdfx2/gdfx2.py \"\$@\"">>/home/gdfx2/gdfx2.sh
RUN echo "err_level=\$?">>/home/gdfx2/gdfx2.sh
RUN echo "deactivate">>/home/gdfx2/gdfx2.sh
RUN echo "exit \$err_level">>/home/gdfx2/gdfx2.sh
RUN chmod +x /home/gdfx2/gdfx2.sh
# copy python source
COPY ./src /home/gdfx2/
ENTRYPOINT ["/home/gdfx2/gdfx2.sh"]