-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
63 lines (51 loc) · 2.9 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
FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
ENV ROS_DISTRO kinetic
ENV HOME=/root
ENV CATKIN_WS=/root/catkin_ws
SHELL ["/bin/bash", "-c"]
RUN apt-get update && apt-get -y upgrade && apt-get -y install git wget vim
# install ROS
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu xenial main" > /etc/apt/sources.list.d/ros-latest.list'
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y ros-${ROS_DISTRO}-desktop-full ros-${ROS_DISTRO}-rqt-*
RUN rosdep init && rosdep update
RUN apt install -y python-rosinstall python-rosinstall-generator python-wstool build-essential
RUN apt-get install -y ros-${ROS_DISTRO}-ros-controllers ros-${ROS_DISTRO}-gazebo* ros-${ROS_DISTRO}-moveit* ros-${ROS_DISTRO}-industrial-core ros-${ROS_DISTRO}-orocos-*
RUN rm -rf /var/lib/apt/lists/*
# ROS setting
RUN mkdir -p $CATKIN_WS/src
WORKDIR $CATKIN_WS
RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> $HOME/.bashrc
RUN echo "export PYTHONPATH=/opt/ros/${ROS_DISTRO}/lib/python2.7/dist-packages" >> $HOME/.bashrc
RUN echo "source $CATKIN_WS/devel/setup.bash" >> $HOME/.bashrc
RUN echo "export ROS_MASTER_URI=http://localhost:11311" >> $HOME/.bashrc
RUN echo "export ROS_HOSTNAME=localhost" >> $HOME/.bashrc
RUN source $HOME/.bashrc
# clone ROS packages
RUN cd src/ && \
git clone -b ${ROS_DISTRO}-devel https://github.com/kairproject/DynamixelSDK.git && \
git clone -b ${ROS_DISTRO}-devel https://github.com/kairproject/dynamixel-workbench.git && \
git clone -b ${ROS_DISTRO}-devel https://github.com/kairproject/dynamixel-workbench-msgs.git && \
git clone -b ${ROS_DISTRO}-devel https://github.com/kairproject/open_manipulator.git && \
git clone -b ${ROS_DISTRO}-devel https://github.com/kairproject/open_manipulator_msgs.git && \
git clone -b ${ROS_DISTRO}-devel https://github.com/kairproject/open_manipulator_simulations.git && \
git clone -b ${ROS_DISTRO}-devel https://github.com/kairproject/robotis_manipulator.git && \
git clone https://github.com/gt-ros-pkg/hrl-kdl.git && \
git clone https://github.com/kairproject/kair_algorithms_draft.git
RUN cd src/DynamixelSDK/python && python setup.py install
# install pip
RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python2.7 get-pip.py && rm get-pip.py
# gym requirements
RUN apt-get update && apt-get install -y python3-opengl zlib1g-dev libjpeg-dev patchelf \
cmake swig libboost-all-dev libsdl2-dev libosmesa6-dev xvfb ffmpeg
# install repository requirements
RUN dpkg -P --force-all python-psutil python-enum34 python-yaml
RUN cd src/kair_algorithms_draft/scripts && python2.7 -m pip install -r requirements.txt
RUN python2.7 -m pip install gym['Box2d']
# permission setting
RUN chmod +x -R src/kair_algorithms_draft
# catkin_make
RUN source /opt/ros/${ROS_DISTRO}/setup.bash && catkin_make
ENTRYPOINT ["/root/catkin_ws/src/kair_algorithms_draft/docker_train.sh"]