-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
100 lines (82 loc) · 3.79 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
99
100
FROM ikeyasu/opengl:cuda9.0-cudnn7-devel-ubuntu16.04
MAINTAINER ikeyasu <[email protected]>
ENV DEBIAN_FRONTEND oninteractive
############################################
# Basic dependencies
############################################
RUN apt-get update --fix-missing && apt-get install -y \
python3-numpy python3-matplotlib python3-dev \
python3-opengl python3-pip \
cmake zlib1g-dev libjpeg-dev xvfb libav-tools \
xorg-dev libboost-all-dev libsdl2-dev swig \
git wget openjdk-8-jdk ffmpeg unzip\
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
############################################
# Change the working directory
############################################
WORKDIR /opt
############################################
# OpenAI Gym and Keras
# It seems that keras always use the module installed last.
# https://github.com/fchollet/keras/issues/6997
############################################
RUN pip3 install --upgrade pip
RUN pip3 install h5py keras future pyvirtualdisplay 'gym[atari]' 'gym[box2d]' 'gym[classic_control]'
############################################
# Roboschool
# https://github.com/openai/roboschool/blob/d057eaa/Dockerfile
############################################
RUN apt-get update && apt-get install -y \
git cmake ffmpeg pkg-config \
qtbase5-dev libqt5opengl5-dev libassimp-dev \
patchelf curl\
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*\
&& git clone --depth 1 https://github.com/openai/roboschool
ENV ROBOSCHOOL_PATH /opt/roboschool
RUN cd $ROBOSCHOOL_PATH && bash -c ". ./exports.sh && ./install_boost.sh"
RUN cd $ROBOSCHOOL_PATH && bash -c ". ./exports.sh && ./install_bullet.sh"
RUN cd /usr/lib/x86_64-linux-gnu && ln -s libboost_python-py35.so libboost_python35.so
RUN cd $ROBOSCHOOL_PATH && bash -c ". ./exports.sh && PYTHONPATH=/usr/bin/python3 CPLUS_INCLUDE_PATH=/usr/include/python3.5 ./roboschool_compile_and_graft.sh"
RUN pip install -e $ROBOSCHOOL_PATH
# test
RUN python3 -c "import gym; gym.make('roboschool:RoboschoolAnt-v1').reset()"
############################################
# marlo
############################################
RUN pip3 install -U malmo
RUN pip3 install -U marlo
RUN cd /opt \
&& python3 -c 'import malmo.minecraftbootstrap; malmo.minecraftbootstrap.download()' \
&& chown -R user:user MalmoPlatform/
ENV MALMO_MINECRAFT_ROOT /opt/MalmoPlatform/Minecraft
############################################
# Deep Reinforcement Learning
# OpenAI Baselines
# Keras-RL
# ChainerRL
############################################
RUN pip3 install keras-rl opencv-python
RUN pip3 install chainer==5.1.0 cupy-cuda90==5.1.0 chainerrl==0.6.0
# Need to remove mujoco dependency from baselines
RUN git clone --depth 1 https://github.com/openai/baselines.git \
&& sed --in-place 's/mujoco,//' baselines/setup.py \
&& pip3 install mpi4py cloudpickle
############################################
# Tensorflow (GPU)
# If tensorflow and tensorflow-gpu are installed simultaneously,
# keras selects tensorflow (CPU). So, I uninstall the cpu version,
# and install the gpu version at the end.
############################################
RUN pip3 install tensorflow-gpu==1.8
############################################
# PyBullet
############################################
RUN pip3 install pybullet==2.5.0
RUN sed -i 's/robot_bases/pybullet_envs.robot_bases/' /usr/local/lib/python3.5/dist-packages/pybullet_envs/robot_locomotors.py
############################################
# locate, less, lxterminal, and vim
############################################
RUN apt-get update && apt-get install -y mlocate less vim lxterminal mesa-utils\
&& updatedb\
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
ENV APP "lxterminal -e bash"