-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
132 lines (122 loc) · 5.35 KB
/
Dockerfile
File metadata and controls
132 lines (122 loc) · 5.35 KB
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
FROM nvidia/cudagl:10.2-devel-ubuntu16.04
SHELL ["/bin/bash", "-c"]
WORKDIR /usr/local/src
# basic utils
RUN apt-get update && \
apt-get install -y --no-install-recommends apt-utils sudo dialog wget lsb-release vim build-essential git unzip cmake software-properties-common && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
# install cudnn
ENV CUDNN_VERSION 7.6.5.32
LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
RUN apt-get update && \
apt-get install -y --no-install-recommends libcudnn7=$CUDNN_VERSION-1+cuda10.2 libcudnn7-dev=$CUDNN_VERSION-1+cuda10.2 && \
apt-mark hold libcudnn7 && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
# install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends software-properties-common && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
# Thanks to https://github.com/crigroup/openrave-installation
RUN apt-get update && \
git clone --depth=1 https://github.com/crigroup/openrave-installation.git && \
cd /usr/local/src/openrave-installation && \
./install-dependencies.sh && \
cd /usr/local/src/openrave-installation && \
./install-osg.sh && \
cd /usr/local/src/openrave-installation && \
./install-fcl.sh && \
cd /usr/local/src/openrave-installation && \
./install-openrave.sh && \
rm -rf /root/git && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
# install ompl
RUN apt-get update && \
apt-get -y install g++ cmake pkg-config libboost-serialization-dev libboost-filesystem-dev libboost-system-dev \
libboost-program-options-dev libboost-test-dev libeigen3-dev libode-dev wget libyaml-cpp-dev && \
git clone --recursive --branch 1.4.2 --depth 1 https://github.com/ompl/ompl.git && \
mkdir -p ompl/build/Release && \
cd ompl/build/Release && \
cmake ../.. -DPYTHON_EXEC=/usr/bin/python && \
make install && \
cd /usr/local/src && \
rm -rf ompl && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/* && \
ln -sf /usr/include/eigen3/Eigen /usr/include/Eigen
# install ROS
RUN echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list && \
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ros-kinetic-ros-base && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/* && \
rosdep init
RUN apt-get update && \
apt-get install -y --no-install-recommends ros-kinetic-urdfdom-py ros-kinetic-srdfdom liburdfdom-headers-dev ros-kinetic-urdf && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
# set locales
RUN apt-get update && \
apt-get install -y --no-install-recommends python3-pip locales locales-all && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
# install conda
RUN wget -O miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
chmod +x /usr/local/src/miniconda.sh && \
/usr/local/src/miniconda.sh -b -p /opt/conda && \
rm /usr/local/src/miniconda.sh && \
/opt/conda/bin/conda install -y python=3 conda-build && \
/opt/conda/bin/conda clean -ya && \
chmod -R ugo+rw /opt/conda/
ENV PATH /opt/conda/bin:$PATH
# install libtorch
RUN wget -O libtorch.zip https://download.pytorch.org/libtorch/cu102/libtorch-cxx11-abi-shared-with-deps-1.8.1%2Bcu102.zip && \
unzip libtorch.zip && \
rm libtorch.zip && \
cp -r libtorch/bin libtorch/include libtorch/lib libtorch/share /usr/local/ && \
rm -rf libtorch
# Patch: install ssh-client so that we can use git inside the container
RUN apt-get update && \
apt-get install -y --no-install-recommends ssh-client && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
# add a user "compnetx" with password "compnetx"
RUN useradd -m compnetx && \
echo "compnetx:compnetx" | chpasswd && \
adduser compnetx sudo
# change user and workdir
USER compnetx
WORKDIR /home/compnetx
# install ROS packages
RUN mkdir -p /home/compnetx/catkin_ws/src
COPY --chown=compnetx catkin_ws/src/baxter_common /home/compnetx/catkin_ws/src/baxter_common
RUN rosdep update && \
echo "source /opt/ros/kinetic/setup.bash" >> /home/compnetx/.bashrc && \
echo "source /home/compnetx/catkin_ws/devel/setup.bash" >> /home/compnetx/.bashrc && \
source /opt/ros/kinetic/setup.bash && \
cd /home/compnetx/catkin_ws/src && \
git clone --depth 1 --branch kinetic-devel https://github.com/ros-planning/srdfdom.git && \
git clone --depth 1 --branch kinetic_fixes https://github.com/personalrobotics/or_urdf.git && \
git clone --depth 1 https://github.com/personalrobotics/openrave_catkin.git && \
git clone --depth 1 https://github.com/ros/urdfdom.git && \
cd /home/compnetx/catkin_ws && \
catkin_make
# install pytorch
RUN conda init
RUN pip3 install --no-cache-dir torch torchvision torchaudio pyyaml h5py numpy tensorboard
RUN pip2 install --no-cache-dir pyyaml tqdm future