-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
137 lines (108 loc) · 6.28 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
FROM nvidia/cuda:8.0-runtime-ubuntu16.04
#FROM ros:kinetic-ros-base
# osrf/ros:kinetic-desktop-full
LABEL maintainer "vvjagtap@wpi.edu"
SHELL ["/bin/bash", "-c"]
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN cat /etc/resolv.conf
RUN apt-get -y update && apt-get install -y sudo apt-utils
# Create a user
RUN export uid=1000 gid=1000 && \
mkdir -p /home/whrl && \
echo "whrl:x:${uid}:${gid}:Whrl,,,:/home/whrl:/bin/bash" >> /etc/passwd && \
echo "whrl:x:${uid}:" >> /etc/group && \
echo "whrl ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/whrl && \
chmod 0440 /etc/sudoers.d/whrl && \
chown ${uid}:${gid} -R /home/whrl
USER whrl
ENV HOME /home/whrl
# Installing general required packages
# Install drcsim
RUN /bin/bash -c "sudo chown -R whrl:whrl /home/whrl"
RUN /bin/bash -c "echo 'source /opt/ros/kinetic/setup.bash' >> ~/.bashrc"
RUN sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu xenial main" > /etc/apt/sources.list.d/ros-latest.list'
RUN sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# Install Dependencies
RUN sudo apt-get -y update && sudo apt-get install -y git \
g++ vim nano wget ca-certificates ssh ros-kinetic-pcl-ros \
x11vnc xvfb icewm lxpanel iperf xz-utils cmake screen terminator konsole\
ros-kinetic-pcl-conversions ros-kinetic-moveit \
ros-kinetic-trac-ik ros-kinetic-footstep-planner \
ros-kinetic-humanoid-localization ros-kinetic-multisense-ros \
ros-kinetic-laser-assembler ros-kinetic-robot-self-filter \
ros-kinetic-tf2-geometry-msgs ros-kinetic-joint-state-publisher \
ros-kinetic-octomap-server ros-kinetic-octomap ros-kinetic-gazebo-ros-control \
ros-kinetic-joint-trajectory-controller ros-kinetic-controller-manager \
ros-kinetic-image-transport \
ros-kinetic-joint-state-controller ros-kinetic-position-controllers \
ros-kinetic-sbpl \
ros-kinetic-humanoid-nav-msgs ros-kinetic-map-server ros-kinetic-trac-ik* \
ros-kinetic-multisense-ros ros-kinetic-robot-self-filter ros-kinetic-octomap \
ros-kinetic-octomap-msgs ros-kinetic-octomap-ros ros-kinetic-gridmap-2d \
software-properties-common python-software-properties debconf-i18n \
ros-kinetic-stereo-image-proc python-vcstool python-catkin-tools ros-kinetic-ros-base \
openjdk-8-jdk openjfx ros-kinetic-effort-controllers ros-kinetic-camera-info-manager \
ros-kinetic-gazebo-plugins ros-kinetic-fiducials ros-kinetic-moveit-visual-tools
RUN sudo rosdep init
RUN rosdep update
# Create a catkin workspace
RUN /bin/bash -c "source /opt/ros/kinetic/setup.bash && \
mkdir ~/kinetic_ws"
RUN /bin/bash -c "source /opt/ros/kinetic/setup.bash && \
cd ~/kinetic_ws && catkin config --init --mkdirs && \
cd src && \
wget https://raw.githubusercontent.com/WPI-Humanoid-Robotics-Lab/atlas_workspace/master/atlas_gazebo_ws.yaml && \
vcs import < atlas_gazebo_ws.yaml && cd .. && \
rm -r ~/kinetic_ws/src/tough && \
rosdep install --from-paths src --ignore-src -r -y"
#RUN git clone https://github.com/ninja777/urdf_controller_test.git ~/kinetic_ws/src/reflex_hand_model
#Install jdk8 with javafx support
#RUN sudo add-apt-repository -y ppa:webupd8team/java
#RUN sudo apt-get update
#RUN echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
#RUN sudo apt-get install -y oracle-java8-installer && sudo rm -rf /var/lib/apt/lists/
#
##set default java to version 8
RUN echo 'export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/' >> ~/.bashrc
#RUN sudo rm /usr/lib/jvm/default-java
RUN sudo ln -s /usr/lib/jvm/java-8-openjdk-amd64 /usr/lib/jvm/default-java
RUN /bin/bash -c "echo 'source ~/kinetic_ws/install/share/drcsim/setup.sh' >> ~/.bashrc"
RUN /bin/bash -c "echo 'source ~/kinetic_ws/devel/setup.bash' >> ~/.bashrc"
RUN /bin/bash -c "echo 'ulimit -s unlimited' >> ~/.bashrc"
RUN /bin/bash -c "echo 'ulimit -c unlimited'>> ~/.bashrc"
RUN /bin/bash -c "echo 'export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64' >> ~/.bashrc"
RUN /bin/bash -c "echo 'export IHMC_SOURCE_LOCATION=$HOME/repository-group/ihmc-open-robotics-software'>> ~/.bashrc"
RUN /bin/bash -c "source /opt/ros/kinetic/setup.bash && \
cd ~/kinetic_ws && catkin_make install"
RUN /bin/bash -c "source ~/.bashrc"
RUN sudo bash -c 'echo "@ros - rtprio 99" > /etc/security/limits.d/ros-rtprio.conf'
RUN sudo groupadd ros
RUN sudo usermod -a -G ros whrl
RUN cd && git clone https://github.com/ihmcrobotics/repository-group.git
RUN cd ~/repository-group && git clone https://github.com/WPI-Humanoid-Robotics-Lab/ihmc-open-robotics-software.git
RUN cd ~/repository-group/ihmc-open-robotics-software && git checkout gazebo_devel && ./gradlew
RUN /bin/bash -c 'source ~/.bashrc && export ROS_MASTER_URI=http://localhost:11311 && \
export ROS_IP=127.0.0.1 && roslaunch ihmc_atlas_ros atlas_warmup_gradle_cache.launch'
RUN sudo bash -c "touch /etc/ld.so.conf.d/nvidia.conf"
RUN sudo bash -c 'echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf'
RUN sudo bash -c 'echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf'
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
#nvidia-384 installs lightdm that requires a keyboard input. To avoid that popup, copy an existing keyboard layout file
COPY ./keyboard /etc/default/keyboard
RUN sudo mkdir -p /usr/lib/nvidia/
RUN sudo apt-get -y update && sudo DEBIAN_FRONTEND=noninteractive apt-get -y install nvidia-384
RUN sudo bash -c 'echo "org.gradle.jvmargs=-Xms4096m -Xmx4096m" > ~/.gradle/gradle.properties'
RUN sudo rm -rf /var/lib/apt/lists/
RUN /bin/bash -c "echo export DISPLAY=:0 >> ~/.bashrc"
ARG ip
ENV IP=$ip
RUN echo "IP is ${IP}"
RUN /bin/bash -c "echo 'export ROS_MASTER_URI=http://${IP}:11311' >> ~/.bashrc"
RUN /bin/bash -c "echo 'export ROS_IP=${IP}' >> ~/.bashrc"
RUN cd ~ && mkdir -p .ihmc/lib/openh264-1.7.0-64
RUN cd ~/.ihmc/lib/openh264-1.7.0-64 && wget https://github.com/WPI-Humanoid-Robotics-Lab/drcsim_docker/raw/rbe-595/openh264-1.7.0-64/libihmcVideoCodecs.so.20171019203925 https://github.com/WPI-Humanoid-Robotics-Lab/drcsim_docker/raw/rbe-595/openh264-1.7.0-64/libopenh264.so.4
CMD /bin/bash -c 'source ~/.bashrc && roslaunch ihmc_atlas_ros ihmc_atlas_gazebo.launch gzname:="gzserver" '