-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-minimal.ros
56 lines (45 loc) · 1.79 KB
/
Dockerfile-minimal.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
55
56
# Build arguments
ARG UBUNTU_RELEASE_YEAR
ARG ZED_SDK_MAJOR
ARG ZED_SDK_MINOR
ARG CUDA_MAJOR
ARG CUDA_MINOR
# Specify the parent image from which we build
FROM stereolabs/zed:${ZED_SDK_MAJOR}.${ZED_SDK_MINOR}-devel-cuda${CUDA_MAJOR}.${CUDA_MINOR}-ubuntu${UBUNTU_RELEASE_YEAR}.04
ARG ROS_DISTRO_ARG
ENV LOGNAME root
ENV ROS_DISTRO ${ROS_DISTRO_ARG}
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
# Setup ROS
RUN apt-get update -y || true && \
apt-get install -y tzdata curl && \
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' && \
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - && \
apt-get update || true && \
apt-get install --no-install-recommends -y ros-${ROS_DISTRO}-ros-base build-essential cmake usbutils libusb-1.0-0-dev git --allow-unauthenticated && \
apt-get install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool && \
apt-get install -y ros-noetic-catkin python3-catkin-tools python3-osrf-pycommon && \
rm -rf /var/lib/apt/lists/*
# Creating workspace
ENV ROS_WS /opt/ros_ws
RUN mkdir -p ${ROS_WS}/src
# 'src' folder setup
COPY src ${ROS_WS}/src
WORKDIR ${ROS_WS}/src
# if have to clone packages to src, Uncomment below lines
# RUN git clone <repo>
#
RUN apt-get update || true && \
rosdep init && \
rosdep update && \
rosdep install --from-paths ${ROS_WS}/src --ignore-src --rosdistro noetic -r -y && \
rm -rf /var/lib/apt/lists/*
# Building workspace
WORKDIR ${ROS_WS}
RUN . /opt/ros/noetic/setup.sh && catkin config --extend /opt/ros/noetic --cmake-args -DCMAKE_BUILD_TYPE=Release && catkin build
# setup entrypoint
COPY ./ros_entrypoint.sh /
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]