-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.ros
55 lines (46 loc) · 1.67 KB
/
Dockerfile.ros
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
ARG ROS_DISTRIBUTION
FROM ros:$ROS_DISTRIBUTION-ros-base
LABEL mantainer="[email protected]"
SHELL ["/bin/bash","-c"]
COPY ./requirements /requirements
RUN ls requirements
# install required packages
RUN apt-get update && cat /requirements/deb-packages.txt | xargs apt-get install -y --no-install-recommends && rm -rf /var/lib/apt/lists/*
# Install ROS Packages
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-${ROS_DISTRO}-joystick-drivers \
ros-${ROS_DISTRO}-tf \
ros-${ROS_DISTRO}-rosbridge-suite \
&& rm -rf /var/lib/apt/lists/*
#ROS workspace
ARG BUILD_TYPE
ENV BUILD_ENV=${BUILD_TYPE}
ENV CATKIN_WS=/root/catkin_ws
RUN mkdir -p $CATKIN_WS/src
WORKDIR $CATKIN_WS/src
COPY ./src .
# build and install packages
RUN if [ ${BUILD_ENV} = "install" ]; \
then source /opt/ros/kinetic/setup.bash \
&& apt-get update \
&& cd $CATKIN_WS \
&& rosdep install -y --from-paths . --ignore-src --rosdistro $ROS_DISTRO \
&& catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/$ROS_DISTRO \
&& rm -R src ; \
elif [ $BUILD_ENV = "devel" ]; \
then source /opt/ros/kinetic/setup.bash \
&& apt-get update \
&& cd $CATKIN_WS \
&& rosdep install -y --from-paths . --ignore-src --rosdistro $ROS_DISTRO \
&& catkin_make ; \
else echo "Please select build type [install/devel]" ; \
fi
# copy scripts
#COPY ./scripts/entrypoint.sh /
COPY ./scripts/entrypoint.sh /
COPY ./scripts/ros-app.launch /
EXPOSE 11311
EXPOSE 19997
WORKDIR /root/catkin_ws
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash source /entrypoint.sh"]