Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +39 -33
Dockerfile
CHANGED
@@ -1,44 +1,50 @@
|
|
1 |
-
FROM nvidia/cuda:11.
|
2 |
-
|
3 |
-
ENV DEBIAN_FRONTEND=noninteractive \
|
4 |
-
TZ=Europe/Paris
|
5 |
|
6 |
# Remove any third-party apt sources to avoid issues with expiring keys.
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
10 |
curl \
|
11 |
ca-certificates \
|
12 |
sudo \
|
13 |
git \
|
14 |
-
git-lfs \
|
15 |
-
zip \
|
16 |
-
unzip \
|
17 |
-
htop \
|
18 |
bzip2 \
|
19 |
libx11-6 \
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
#
|
38 |
-
RUN
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
|
44 |
WORKDIR /code
|
|
|
1 |
+
FROM nvidia/cuda:11.8.0-base-ubuntu22.04
|
|
|
|
|
|
|
2 |
|
3 |
# Remove any third-party apt sources to avoid issues with expiring keys.
|
4 |
+
RUN rm -f /etc/apt/sources.list.d/*.list
|
5 |
+
|
6 |
+
# Install some basic utilities.
|
7 |
+
RUN apt-get update && apt-get install -y \
|
8 |
curl \
|
9 |
ca-certificates \
|
10 |
sudo \
|
11 |
git \
|
|
|
|
|
|
|
|
|
12 |
bzip2 \
|
13 |
libx11-6 \
|
14 |
+
&& rm -rf /var/lib/apt/lists/*
|
15 |
+
|
16 |
+
# Create a working directory.
|
17 |
+
RUN mkdir /app
|
18 |
+
WORKDIR /app
|
19 |
+
|
20 |
+
# Create a non-root user and switch to it.
|
21 |
+
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
|
22 |
+
&& chown -R user:user /app
|
23 |
+
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
|
24 |
+
USER user
|
25 |
+
|
26 |
+
# All users can use /home/user as their home directory.
|
27 |
+
ENV HOME=/home/user
|
28 |
+
RUN mkdir $HOME/.cache $HOME/.config \
|
29 |
+
&& chmod -R 777 $HOME
|
30 |
+
|
31 |
+
# Download and install Micromamba.
|
32 |
+
RUN curl -sL https://micro.mamba.pm/api/micromamba/linux-64/1.1.0 \
|
33 |
+
| sudo tar -xvj -C /usr/local bin/micromamba
|
34 |
+
ENV MAMBA_EXE=/usr/local/bin/micromamba \
|
35 |
+
MAMBA_ROOT_PREFIX=/home/user/micromamba \
|
36 |
+
CONDA_PREFIX=/home/user/micromamba \
|
37 |
+
PATH=/home/user/micromamba/bin:$PATH
|
38 |
+
|
39 |
+
# Set up the base Conda environment by installing PyTorch and friends.
|
40 |
+
COPY conda-linux-64.lock /app/conda-linux-64.lock
|
41 |
+
RUN micromamba create -qy -n base -f /app/conda-linux-64.lock \
|
42 |
+
&& rm /app/conda-linux-64.lock \
|
43 |
+
&& micromamba shell init --shell=bash --prefix="$MAMBA_ROOT_PREFIX" \
|
44 |
+
&& micromamba clean -qya
|
45 |
+
|
46 |
+
# Fix for https://github.com/pytorch/pytorch/issues/97041
|
47 |
+
RUN ln -s "$CONDA_PREFIX/lib/libnvrtc.so.11.8.89" "$CONDA_PREFIX/lib/libnvrtc.so"
|
48 |
|
49 |
|
50 |
WORKDIR /code
|