Update Dockerfile
Browse files- Dockerfile +26 -24
Dockerfile
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
# Use the NVIDIA CUDA runtime as a base image
|
2 |
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
|
3 |
|
4 |
# Set environment variables
|
5 |
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
|
|
|
7 |
RUN useradd -m -u 1000 user
|
8 |
-
|
9 |
USER user
|
10 |
|
11 |
ENV HOME=/home/user \
|
@@ -25,7 +25,7 @@ ENV HOME=/home/user \
|
|
25 |
# Set the working directory to the user's home directory
|
26 |
WORKDIR $HOME/app
|
27 |
|
28 |
-
# Install
|
29 |
USER root
|
30 |
RUN apt-get update && apt-get install -y \
|
31 |
wget \
|
@@ -35,30 +35,32 @@ RUN apt-get update && apt-get install -y \
|
|
35 |
gnupg \
|
36 |
libgl1-mesa-glx \
|
37 |
libglib2.0-0 \
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
&& /
|
42 |
-
&& /
|
43 |
-
&& /
|
44 |
-
&&
|
45 |
-
&& rm -rf /var/lib/apt/lists/*
|
46 |
|
47 |
-
#
|
48 |
-
RUN /
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
51 |
|
52 |
-
|
53 |
-
|
54 |
-
RUN /opt/conda/bin/conda env create -f /home/user/app/environment.yaml
|
55 |
-
RUN echo "conda activate gazelle" >> ~/.bashrc
|
56 |
|
57 |
-
# Install
|
|
|
58 |
COPY . .
|
59 |
-
RUN
|
60 |
-
RUN
|
61 |
-
RUN
|
62 |
|
63 |
USER root
|
64 |
# Configure git to trust the directory
|
@@ -72,4 +74,4 @@ ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
|
72 |
ENV CUDA_VISIBLE_DEVICES=0
|
73 |
|
74 |
# Command to run your application
|
75 |
-
CMD ["
|
|
|
1 |
+
# Use the NVIDIA CUDA runtime as a base image for CUDA 11.8
|
2 |
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
|
3 |
|
4 |
# Set environment variables
|
5 |
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
|
7 |
+
# Create a user and set environment variables
|
8 |
RUN useradd -m -u 1000 user
|
|
|
9 |
USER user
|
10 |
|
11 |
ENV HOME=/home/user \
|
|
|
25 |
# Set the working directory to the user's home directory
|
26 |
WORKDIR $HOME/app
|
27 |
|
28 |
+
# Install system dependencies as root
|
29 |
USER root
|
30 |
RUN apt-get update && apt-get install -y \
|
31 |
wget \
|
|
|
35 |
gnupg \
|
36 |
libgl1-mesa-glx \
|
37 |
libglib2.0-0 \
|
38 |
+
python3.9 \
|
39 |
+
python3.9-distutils \
|
40 |
+
python3.9-dev \
|
41 |
+
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.9 \
|
42 |
+
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 \
|
43 |
+
&& update-alternatives --install /usr/bin/pip pip /usr/local/bin/pip 1 \
|
44 |
+
&& apt-get clean
|
|
|
45 |
|
46 |
+
# Install CUDA 11.8 and cuDNN 9.3.0 directly from NVIDIA's repositories
|
47 |
+
RUN curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub | gpg --batch --yes --dearmor -o /usr/share/keyrings/cuda-archive-keyring.gpg \
|
48 |
+
&& echo "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /" > /etc/apt/sources.list.d/cuda.list \
|
49 |
+
&& apt-get update && apt-get install -y \
|
50 |
+
libcudnn9=8.9.3.0-1+cuda11.8 \
|
51 |
+
libcudnn9-dev=8.9.3.0-1+cuda11.8 \
|
52 |
+
libcudnn9-doc=8.9.3.0-1+cuda11.8 \
|
53 |
+
&& apt-get clean
|
54 |
|
55 |
+
# Verify CUDA and cuDNN installation
|
56 |
+
RUN dpkg-query -W libcudnn9
|
|
|
|
|
57 |
|
58 |
+
# Install Python dependencies
|
59 |
+
USER user
|
60 |
COPY . .
|
61 |
+
RUN pip install --upgrade pip
|
62 |
+
RUN pip install -r requirements.txt
|
63 |
+
RUN pip install gradio
|
64 |
|
65 |
USER root
|
66 |
# Configure git to trust the directory
|
|
|
74 |
ENV CUDA_VISIBLE_DEVICES=0
|
75 |
|
76 |
# Command to run your application
|
77 |
+
CMD ["python", "app.py"]
|