-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
177 lines (123 loc) · 4.38 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# Select base image
FROM ros:noetic-ros-base
# Set environment variables that persist in the container
ENV DEBIAN_FRONTEND=noninteractive
ENV ROS_DISTRO=noetic
ENV ROS_ROOT=/opt/ros/$ROS_DISTRO
ENV ROSDEP_SOURCES=/etc/ros/rosdep/sources.list.d
ENV TZ=Europe/Amsterdam
ENV ROOT=/root
ENV WS=$ROOT/catkin_ws
ENV DISPLAY=:0
COPY .tmux.conf $ROOT/.tmux.conf
# Set the timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Create the ROOT directory
RUN mkdir -p $ROOT
# Install ubuntu packages
RUN apt-get update \
&& apt install -y --no-install-recommends \
build-essential \
git \
python3-catkin-tools \
python3-pip \
tmux \
curl \
lsb-release \
gnupg2 \
tmuxp \
npm \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt install -y --no-install-recommends \
ros-noetic-cv-bridge \
ros-noetic-tf2-ros \
ros-noetic-tf \
ros-noetic-image-transport \
ros-noetic-image-transport-plugins \
ros-noetic-compressed-image-transport \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt install -y --no-install-recommends \
libeigen3-dev \
ros-noetic-rqt-reconfigure \
ros-noetic-diagnostic-updater \
ros-noetic-tf2 \
ros-noetic-vision-opencv \
ros-noetic-image-common \
ros-noetic-actionlib-tools \
ros-noetic-dynamic-reconfigure \
ros-noetic-ddynamic-reconfigure \
ros-noetic-rosbridge-suite \
ros-noetic-franka-gripper \
ros-noetic-franka-msgs \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
RUN sudo mkdir -p /etc/apt/keyrings
RUN curl -sSf https://librealsense.intel.com/Debian/librealsense.pgp | tee /etc/apt/keyrings/librealsense.pgp > /dev/null
RUN echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/librealsense.list
# Install librealsense2
RUN apt-get update && apt-get install -y librealsense2-dev
# Install curl to download Node.js setup script
RUN apt-get update && \
apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
# Ensure you have the correct Node.js version
RUN node -v
# Upgrade npm to version 10.8.2
RUN npm install -g npm@10.8.2 && npm -v && npm cache clean --force
RUN apt-get update && apt-get install -y \
libx11-xcb1 \
libxcb1 \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
# Create catkin workspace
RUN mkdir -p $WS/src \
&& cd $WS \
&& catkin init \
&& catkin config --extend /opt/ros/$ROS_DISTRO \
&& catkin build
# Clone required packages
RUN cd $WS/src \
&& git clone https://github.com/platonics-delft/panda-ros-py.git \
&& git clone https://github.com/platonics-delft/platonics_robot_teaching.git \
&& git clone https://github.com/platonics-delft/platonics_vision.git \
&& git clone https://github.com/platonics-delft/platonics_gui.git \
&& git clone --branch ros1-legacy https://github.com/IntelRealSense/realsense-ros.git \
&& git clone https://github.com/platonics-delft/platonics_dataset.git \
&& git clone https://github.com/platonics-delft/platonics_tools.git
RUN echo "Last updated at $(date)" > last_update.txt
## Pull latest changes in repos
RUN cd $WS/src/panda-ros-py \
&& git checkout ft-remove-franka-copies \
&& cd $WS/src/platonics_robot_teaching \
&& git pull \
&& cd $WS/src/platonics_vision \
&& git pull \
&& cd $WS/src/platonics_gui \
&& git pull \
&& cd $WS/src/platonics_dataset \
&& git pull \
&& cd $WS/src/platonics_tools \
&& git pull
# Build the workspace
RUN set -x \
&& cd $WS \
&& catkin build
# Install npm packages
RUN cd $WS/src/platonics_gui \
&& npm install \
&& npm cache clean --force
# Install python dependencies
RUN pip3 install --no-cache-dir -r $WS/src/platonics_robot_teaching/requirements.txt \
&& pip3 install --no-cache-dir -r $WS/src/platonics_dataset/requirements.txt \
&& pip3 install --no-cache-dir -r $WS/src/panda-ros-py/requirements.txt
# Copy tmuxp config file
COPY start_app.yaml $ROOT/start_app.yaml
# Set the entrypoint
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]