-
Notifications
You must be signed in to change notification settings - Fork 148
/
Dockerfile
98 lines (81 loc) · 3.4 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
FROM nvidia/cuda:11.1.1-cudnn8-runtime-ubuntu20.04
SHELL ["/bin/bash", "-c"]
##########################################################
### System dependencies
##########################################################
RUN apt-get update -q \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
cmake \
curl \
git \
libgl1-mesa-dev \
libgl1-mesa-glx \
libglew-dev \
libosmesa6-dev \
ffmpeg \
net-tools \
parallel \
software-properties-common \
swig \
unzip \
vim \
wget \
xpra \
xserver-xorg-dev \
zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV LANG C.UTF-8
COPY ./azure/files/Xdummy /usr/local/bin/Xdummy
RUN chmod +x /usr/local/bin/Xdummy
# Workaround for https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-375/+bug/1674677
COPY ./azure/files/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json
COPY ./environment.yml /opt/environment.yml
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib64:${LD_LIBRARY_PATH}
##########################################################
### gsutil
##########################################################
RUN curl -sSL https://sdk.cloud.google.com | bash
ENV PATH $PATH:/root/google-cloud-sdk/bin
##########################################################
### MuJoCo
##########################################################
# Note: ~ is an alias for /root
RUN mkdir -p /root/.mujoco \
&& wget https://www.roboti.us/download/mujoco200_linux.zip -O mujoco.zip \
&& unzip mujoco.zip -d /root/.mujoco \
&& rm mujoco.zip
RUN mkdir -p /root/.mujoco \
&& wget https://www.roboti.us/download/mjpro150_linux.zip -O mujoco.zip \
&& unzip mujoco.zip -d /root/.mujoco \
&& rm mujoco.zip
RUN ln -s /root/.mujoco/mujoco200_linux /root/.mujoco/mujoco200
ENV LD_LIBRARY_PATH /root/.mujoco/mjpro150/bin:${LD_LIBRARY_PATH}
ENV LD_LIBRARY_PATH /root/.mujoco/mujoco200/bin:${LD_LIBRARY_PATH}
ENV LD_LIBRARY_PATH /root/.mujoco/mujoco200_linux/bin:${LD_LIBRARY_PATH}
COPY ./azure/files/mjkey.txt /root/.mujoco
##########################################################
### Example Python Installation
##########################################################
ENV PATH /opt/conda/bin:$PATH
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
/bin/bash /tmp/miniconda.sh -b -p /opt/conda && \
rm /tmp/miniconda.sh && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> /etc/bash.bashrc
RUN conda update -y --name base conda && conda clean --all -y
RUN git config --global url."https://".insteadOf git://
RUN conda env create -f /opt/environment.yml
ENV PATH /opt/conda/envs/diffuser/bin:$PATH
##########################################################
### gym sometimes has this patchelf issue
##########################################################
RUN curl -o /usr/local/bin/patchelf https://s3-us-west-2.amazonaws.com/openai-sci-artifacts/manual-builds/patchelf_0.9_amd64.elf \
&& chmod +x /usr/local/bin/patchelf
RUN echo "source activate /opt/conda/envs/diffuser && export PYTHONPATH=$PYTHONPATH:/home/code && export CUDA_VISIBLE_DEVICES=0" >> ~/.bashrc
RUN source ~/.bashrc
##########################################################
### mount for repo
##########################################################
RUN mkdir /home/code
RUN mkdir /home/logs