-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (35 loc) · 1.46 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
FROM ros:melodic
ARG SSH_KEY
SHELL [ "/bin/bash", "-c" ]
# Install dependencies
RUN apt-get -qq update > /dev/null && \
apt-get -yqq install sudo \
git \
ssh \
python-catkin-tools \
ros-$ROS_DISTRO-catkin \
ros-$ROS_DISTRO-tf \
ros-$ROS_DISTRO-tf2-geometry-msgs \
libyaml-cpp-dev > /dev/null && \
apt-get clean > /dev/null
WORKDIR /workspace/catkin_ws/src
# Use SSH deploy keys to clone dependencies and then remove the ssh config
RUN mkdir /root/.ssh/ && \
echo "$SSH_KEY" > /root/.ssh/id_rsa && \
chmod -R 600 /root/.ssh/ && \
touch /root/.ssh/known_hosts && \
ssh-keyscan -T 60 git.locomotec.com >> /root/.ssh/known_hosts && \
git clone [email protected]:kelo/common/geometry_common.git && \
git clone [email protected]:kelo/common/yaml_common.git && \
rm -rf /root/.ssh/
# Copy the kelojson source code to the docker container
WORKDIR /workspace/catkin_ws/src/kelojson
ADD . /workspace/catkin_ws/src/kelojson/
# Compile the ROS catkin workspace
RUN cd /workspace/catkin_ws && \
/ros_entrypoint.sh catkin build --no-status
# Run unit tests
RUN source /workspace/catkin_ws/devel/setup.bash && \
cd /workspace/catkin_ws/src/kelojson && \
/ros_entrypoint.sh catkin build --this --no-status --catkin-make-args run_tests -- && \
rosrun kelojson kelojson_test