-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
62 lines (53 loc) · 1.88 KB
/
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
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
FROM nvidia/cuda:11.3.1-base-ubuntu20.04
# 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
#COPY . /home/user/prm-rl
RUN mkdir $HOME/.cache $HOME/.config \
&& sudo chmod -R 777 $HOME
# Set up the Conda environment
ENV CONDA_AUTO_UPDATE_CONDA=false \
PATH=$HOME/miniconda/bin:$PATH
COPY environment.yml /app/environment.yml
RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
&& chmod +x ~/miniconda.sh \
&& ~/miniconda.sh -b -p ~/miniconda \
&& rm ~/miniconda.sh \
&& conda env update -n base -f /app/environment.yml \
&& rm /app/environment.yml \
&& conda clean -ya
RUN sudo rm /etc/apt/sources.list.d/cuda.list
RUN sudo rm /etc/apt/sources.list.d/nvidia-ml.list
RUN sudo apt-get update -q && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
libgl1-mesa-dev \
libgl1-mesa-glx \
libglew-dev \
libosmesa6-dev \
software-properties-common \
vim \
wget \
gcc \
&& sudo apt-get clean \
&& sudo rm -rf /var/lib/apt/lists/*
RUN sudo curl -o /usr/local/bin/patchelf https://s3-us-west-2.amazonaws.com/openai-sci-artifacts/manual-builds/patchelf_0.9_amd64.elf \
&& sudo chmod +x /usr/local/bin/patchelf
RUN sudo mkdir -p /home/user/.mujoco \
&& sudo wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz -O mujoco.tar.gz \
&& sudo tar -xf mujoco.tar.gz -C /home/user/.mujoco \
&& sudo rm mujoco.tar.gz