forked from SamsungLabs/genren
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.bak
63 lines (50 loc) · 1.93 KB
/
Dockerfile.bak
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# FROM nvidia/cuda:12.0.1-cudnn8-devel-ubuntu18.04
# FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu18.04
# FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04
# FROM anibali/pytorch:1.13.0-cuda11.8
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu18.04
# Remove any third-party apt sources to avoid issues with expiring keys.
RUN rm -f /etc/apt/sources.list.d/*.list
# Install some basic utilities.
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
sudo \
git \
bzip2 \
libx11-6 \
&& rm -rf /var/lib/apt/lists/*
# Create a working directory.
RUN mkdir /app
WORKDIR /app
# Create a non-root user and switch to it.
# RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
# && chown -R user:user /app
# RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
# USER user
# All users can use /home/user as their home directory.
# ENV HOME=/home/user
# RUN mkdir $HOME/.cache $HOME/.config \
# && chmod -R 777 $HOME
# Download and install Micromamba.
RUN curl -sL https://micro.mamba.pm/api/micromamba/linux-64/1.1.0 \
| sudo tar -xvj -C /usr/local bin/micromamba
ENV MAMBA_EXE=/usr/local/bin/micromamba \
MAMBA_ROOT_PREFIX=/home/user/micromamba \
CONDA_PREFIX=/home/user/micromamba \
PATH=/home/user/micromamba/bin:$PATH
# Set up the base Conda environment by installing PyTorch and friends.
COPY conda-linux-64.lock /app/conda-linux-64.lock
RUN micromamba create -qy -n base -f /app/conda-linux-64.lock \
&& rm /app/conda-linux-64.lock \
&& micromamba shell init --shell=bash --prefix="$MAMBA_ROOT_PREFIX" \
&& micromamba clean -qya
RUN conda create --name genren python
SHELL ["conda", "run", "-n", "base", "/bin/bash", "-c"]
COPY . /app
RUN pip install torch==2.0.0+cu118 torchvision==0.15.1+cu118 -f https://download.pytorch.org/whl/torch_stable.html
RUN conda init bash
RUN echo "conda activate base" >> ~/.bashrc
ENV PATH /opt/conda/envs/base/bin:$PATH
ENV CONDA_DEFAULT_ENV $base
RUN bash