ruslanmv commited on
Commit
63dfcde
1 Parent(s): fabbe1e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +39 -33
Dockerfile CHANGED
@@ -1,44 +1,50 @@
1
- FROM nvidia/cuda:11.3.1-base-ubuntu20.04
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
- # Install some basic utilities
8
- RUN rm -f /etc/apt/sources.list.d/*.list && \
9
- apt-get update && apt-get install -y --no-install-recommends \
 
10
  curl \
11
  ca-certificates \
12
  sudo \
13
  git \
14
- git-lfs \
15
- zip \
16
- unzip \
17
- htop \
18
  bzip2 \
19
  libx11-6 \
20
- build-essential \
21
- libsndfile-dev \
22
- software-properties-common \
23
- && rm -rf /var/lib/apt/lists/*
24
-
25
- # Install Python 3.10 and pip
26
- RUN add-apt-repository ppa:deadsnakes/ppa && \
27
- apt-get update && apt-get install -y --no-install-recommends \
28
- python3.10 \
29
- python3.10-distutils \
30
- && rm -rf /var/lib/apt/lists/* && \
31
- update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \
32
- update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 && \
33
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
34
- python get-pip.py && \
35
- rm get-pip.py
36
-
37
- # Set Python 3.10 as the default python version
38
- RUN update-alternatives --set python3 /usr/bin/python3.10 && \
39
- update-alternatives --set python /usr/bin/python3.10
40
-
41
- RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
 
 
 
 
 
 
 
 
 
 
 
 
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