-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.garage
96 lines (84 loc) · 2.94 KB
/
Dockerfile.garage
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
# To be used as a base image for your project. In your project's image
# make sure you place your MuJoCo key at /root/.mujoco/
FROM ubuntu:18.04
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
# apt dependencies
RUN \
apt-get -y -q update && \
# Prevents debconf from prompting for user input
# See https://github.com/phusion/baseimage-docker/issues/58
DEBIAN_FRONTEND=noninteractive apt-get install -y \
# Dockerfile deps
wget \
unzip \
git \
curl \
# For building glfw
cmake \
xorg-dev \
# mujoco_py
# See https://github.com/openai/mujoco-py/blob/master/Dockerfile
# 18.04 repo is old, install glfw from source instead
# libglfw3 \
libglew-dev \
libosmesa6-dev \
patchelf \
# OpenAI baselines
libopenmpi-dev \
# virtualenv
python3 \
python3-pip \
python3-tk \
python3-virtualenv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Build GLFW because the Ubuntu 18.04 version is too old
# See https://github.com/glfw/glfw/issues/1004
RUN apt-get purge -y -v libglfw*
RUN wget https://github.com/glfw/glfw/releases/download/3.3/glfw-3.3.zip && \
unzip glfw-3.3.zip && \
rm glfw-3.3.zip && \
cd glfw-3.3 && \
mkdir glfw-build && \
cd glfw-build && \
cmake -DBUILD_SHARED_LIBS=ON -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF .. && \
make -j"$(nproc)" && \
make install && \
cd ../../ && \
rm -rf glfw
# MuJoCo 2.0 (for dm_control)
RUN mkdir -p /root/.mujoco && \
wget https://www.roboti.us/download/mujoco200_linux.zip -O mujoco.zip && \
unzip mujoco.zip -d $HOME/.mujoco && \
rm mujoco.zip && \
ln -s $HOME/.mujoco/mujoco200_linux $HOME/.mujoco/mujoco200
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mujoco200/bin
# Copy over just setup.py first, so the Docker cache doesn't expire until
# dependencies change
#
# Files needed to run setup.py
# - README.md
# - roam_rl/__init__.py
# - setup.py
COPY README.md /root/code/roam_rl/README.md
COPY roam_rl/__init__.py /root/code/roam_rl/roam_rl/__init__.py
COPY setup.py /root/code/roam_rl/setup.py
WORKDIR /root/code/roam_rl
# Create virtualenv
ENV VIRTUAL_ENV=/root/venv
RUN python3 -m virtualenv --python=/usr/bin/python3 $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Prevent pip from complaining about available upgrades
RUN pip install --upgrade pip
# Install pip dependencies
# Note: Empty license file for installing mujoco_py
RUN touch /root/.mujoco/mjkey.txt && pip install mujoco_py && rm /root/.mujoco/mjkey.txt && \
pip install git+https://[email protected]/rlworkgroup/[email protected]#egg=garage&& \
pip install git+https://[email protected]/roamlab/confac@master#egg=confac && \
pip install git+https://[email protected]/roamlab/roam_env@master#egg=roam_env && \
pip install -e . && \
rm -r /root/.cache/pip
COPY . /root/code/roam_rl/
CMD /bin/bash