|
| 1 | +FROM nvidia/opengl:1.0-glvnd-runtime-ubuntu16.04 |
| 2 | + |
| 3 | +LABEL maintainer "Samir Tabriz" |
| 4 | + |
| 5 | +ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES},display,compute,utility |
| 6 | + |
| 7 | +RUN apt-get update \ |
| 8 | + && apt-get install -y --no-install-recommends mesa-utils \ |
| 9 | + && rm -rf /var/lib/apt/lists/* |
| 10 | + |
| 11 | +RUN apt-get update \ |
| 12 | + && apt-get install -y --no-install-recommends ocl-icd-libopencl1 clinfo \ |
| 13 | + && rm -rf /var/lib/apt/lists/* |
| 14 | + |
| 15 | +RUN mkdir -p /etc/OpenCL/vendors \ |
| 16 | + && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd |
| 17 | + |
| 18 | +ENV NVIDIA_VISIBLE_DEVICES=all |
| 19 | + |
| 20 | +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \ |
| 21 | + && echo keyboard-configuration keyboard-configuration/layout select 'English (US)' | debconf-set-selections \ |
| 22 | + && echo keyboard-configuration keyboard-configuration/layoutcode select 'us' | debconf-set-selections \ |
| 23 | + && apt-get update \ |
| 24 | + && apt-get install -y --no-install-recommends software-properties-common wget udev apt-utils sudo |
| 25 | + |
| 26 | +RUN add-apt-repository -y ppa:danielrichter2007/grub-customizer \ |
| 27 | + && wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | apt-key add - \ |
| 28 | + && apt-get install -y apt-transport-https \ |
| 29 | + && echo "deb https://download.sublimetext.com/ apt/stable/" | tee /etc/apt/sources.list.d/sublime-text.list \ |
| 30 | + && apt-add-repository -y ppa:obsproject/obs-studio \ |
| 31 | + && apt-add-repository -y ppa:graphics-drivers/ppa \ |
| 32 | + && add-apt-repository -y ppa:yannubuntu/boot-repair \ |
| 33 | + && apt-get update \ |
| 34 | + && apt-get install -y sublime-text grub-customizer exfat-fuse exfat-utils vim terminator gitg cmake-curses-gui gparted meld cowsay fortune gimp synaptic libgoogle-glog-dev libatlas-base-dev libeigen3-dev libsuitesparse-dev ncdu filezilla p7zip-full openssh-client openssh-server boot-repair |
| 35 | + |
| 36 | +RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' \ |
| 37 | + && apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 \ |
| 38 | + && apt-get update \ |
| 39 | + && apt-get install ros-kinetic-desktop-full python-rosinstall -y \ |
| 40 | + && rosdep init \ |
| 41 | + && rosdep update |
| 42 | + |
| 43 | +RUN /bin/bash -c "echo 'source /opt/ros/kinetic/setup.bash' >> /root/.bashrc \ |
| 44 | + && source /root/.bashrc" |
| 45 | + |
| 46 | +RUN add-apt-repository -y ppa:levi-armstrong/ppa \ |
| 47 | + && apt-get update |
| 48 | + |
| 49 | +RUN /bin/bash -c "source /opt/ros/kinetic/setup.bash \ |
| 50 | + && cd \ |
| 51 | + && mkdir -p workspace/ros/src \ |
| 52 | + && cd workspace/ros \ |
| 53 | + && catkin_make" |
| 54 | + |
| 55 | +RUN /bin/bash -c "echo 'source /root/workspace/ros/devel/setup.bash' >> /root/.bashrc" |
| 56 | + |
| 57 | +RUN cd ~/workspace/ros \ |
| 58 | + && apt-get install -y ocl-icd-opencl-dev \ |
| 59 | + && wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run -O cuda.run \ |
| 60 | + && chmod +x cuda.run \ |
| 61 | + && ./cuda.run -silent --toolkit \ |
| 62 | + && wget "https://www.dropbox.com/s/cx95583vbf1ifzm/cudnn-8.0-linux-x64-v5.1.tgz?dl%3D0&sa=D&ust=1507541105896000&usg=AFQjCNEU511fT00n547PxPt_P6cfSLPVWw" \ |
| 63 | + && tar -zxvf cudnn* \ |
| 64 | + && cp cuda/include/* /usr/local/cuda/include \ |
| 65 | + && cp cuda/lib64/* /usr/local/cuda/lib64/ \ |
| 66 | + && echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64' >> ~/.bashrc \ |
| 67 | + && echo 'export PATH=$PATH:/usr/local/cuda/bin' >> ~/.bashrc |
| 68 | + |
| 69 | +RUN cd \ |
| 70 | + && cd workspace \ |
| 71 | + && git clone https://github.com/openptrack/libfreenect2 \ |
| 72 | + && cd libfreenect2 \ |
| 73 | + && git checkout 1604 \ |
| 74 | + && cd depends/ \ |
| 75 | + && apt-get install -y git cmake cmake-curses-gui libxmu-dev libxi-dev libgl1-mesa-dev dos2unix xorg-dev libglu1-mesa-dev libtool automake libudev-dev libgtk2.0-dev pkg-config libjpeg-turbo8-dev libturbojpeg libglewmx-dev \ |
| 76 | + && ./install_ubuntu.sh \ |
| 77 | + && ln -f -s /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0.1.0 /usr/lib/x86_64-linux-gnu/libturbojpeg.so \ |
| 78 | + && cd ../examples/protonect/ \ |
| 79 | + && mkdir build \ |
| 80 | + && cd build \ |
| 81 | + && /bin/bash -c "source /opt/ros/kinetic/setup.bash \ |
| 82 | + && cmake .. \ |
| 83 | + && make \ |
| 84 | + && make install" \ |
| 85 | + && echo '# ATTR{product}=="Kinect2" SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02c4", MODE="0666" SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02d8", MODE="0666" SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02d9", MODE="0666"' > ~/90-kinect2.rules \ |
| 86 | + && mv ~/90-kinect2.rules /etc/udev/rules.d/90-kinect2.rules |
| 87 | + |
| 88 | +RUN cd ~/workspace/ros/src \ |
| 89 | + && git clone https://github.com/openptrack/iai_kinect2 \ |
| 90 | + && cd iai_kinect2 \ |
| 91 | + && git checkout 1604 |
| 92 | + |
| 93 | +RUN apt-get install cmake libgoogle-glog-dev libatlas-base-dev libeigen3-dev libsuitesparse-dev -y --force-yes \ |
| 94 | + && mkdir /tmp/ceres_install \ |
| 95 | + && cd /tmp/ceres_install \ |
| 96 | + && git clone https://ceres-solver.googlesource.com/ceres-solver \ |
| 97 | + && cd ceres-solver \ |
| 98 | + && git fetch --tags \ |
| 99 | + && git checkout tags/1.9.0 \ |
| 100 | + && cd .. \ |
| 101 | + && mkdir ceres-bin \ |
| 102 | + && cd ceres-bin \ |
| 103 | + && cmake ../ceres-solver \ |
| 104 | + && make -j8 \ |
| 105 | + && make test \ |
| 106 | + && make install \ |
| 107 | + && rm -R /tmp/ceres_install \ |
| 108 | + && cd ~/workspace/ros/src \ |
| 109 | + && git clone https://github.com/iaslab-unipd/calibration_toolkit \ |
| 110 | + && cd calibration_toolkit \ |
| 111 | + && git fetch origin --tags \ |
| 112 | + && git checkout tags/v0.2 |
| 113 | + |
| 114 | +RUN cd \ |
| 115 | + && cd workspace \ |
| 116 | + && apt-get update \ |
| 117 | + && git clone https://github.com/marketto89/opencv \ |
| 118 | + && cd opencv \ |
| 119 | + && git checkout 3.1.0-with-cuda8 \ |
| 120 | + && mkdir release \ |
| 121 | + && cd release \ |
| 122 | + && cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv3 -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D WITH_IPP=ON -D CMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs .. \ |
| 123 | + && make -j8 -l8 \ |
| 124 | + && make install \ |
| 125 | + && printf '#OpenCV\nPKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opencv3/lib/pkgconfig\nexport PKG_CONFIG_PATH\n' >> /root/.bashrc \ |
| 126 | + && printf 'PATH=$PATH:/usr/local/opencv3/bin\nexport PATH\n' >> /root/.bashrc \ |
| 127 | + && printf 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/opencv3/lib\nexport LD_LIBRARY_PATH\n' >> /root/.bashrc \ |
| 128 | + && /bin/bash -c "source /root/.bashrc" \ |
| 129 | + && ln -s /usr/local/opencv3/share/OpenCV/3rdparty/lib/libippicv.a /usr/local/lib/libippicv.a |
| 130 | + |
| 131 | +RUN /bin/bash -c "source /root/.bashrc \ |
| 132 | + && cd ~/workspace/ros/src \ |
| 133 | + && git clone https://bitbucket.org/mcarraro/rtpose_wrapper \ |
| 134 | + && cd rtpose_wrapper \ |
| 135 | + && git checkout integration-1604 \ |
| 136 | + && apt-get --assume-yes install libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libboost-all-dev libgflags-dev libgoogle-glog-dev liblmdb-dev \ |
| 137 | + && make all -j8" |
| 138 | + |
| 139 | +RUN /bin/bash -c "git clone https://github.com/torch/distro.git ~/torch --recursive \ |
| 140 | + && cd ~/torch \ |
| 141 | + && bash install-deps \ |
| 142 | + && ./install.sh -b \ |
| 143 | + && source ~/.bashrc \ |
| 144 | + && cd install/bin \ |
| 145 | + && ./luarocks install dpnn \ |
| 146 | + && ./luarocks install csvigo" |
| 147 | + |
| 148 | +RUN /bin/bash -c "cd /tmp \ |
| 149 | + && git clone https://github.com/cmusatyalab/openface.git \ |
| 150 | + && cd openface \ |
| 151 | + && sudo python setup.py install" |
| 152 | + |
| 153 | +RUN /bin/bash -c "cd /tmp \ |
| 154 | + && rm -rf dlib \ |
| 155 | + && git clone https://github.com/davisking/dlib.git \ |
| 156 | + && cd dlib \ |
| 157 | + && git checkout v19.4 \ |
| 158 | + && mkdir python_examples/build \ |
| 159 | + && cd python_examples/build \ |
| 160 | + && cmake ../../tools/python -DUSE_AVX_INSTRUCTIONS=ON \ |
| 161 | + && cmake --build . --config Release \ |
| 162 | + && sudo cp dlib.so /usr/local/lib/python2.7/dist-packages" |
| 163 | + |
| 164 | +RUN apt-get update \ |
| 165 | + && apt-get install -y python-qt4 python-pip \ |
| 166 | + && pip install requests |
| 167 | + |
| 168 | +RUN apt-get install ntp -y \ |
| 169 | + && rm -rf /var/lib/apt/lists/* |
0 commit comments