-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ros2
40 lines (30 loc) · 2.01 KB
/
Dockerfile.ros2
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
ARG ROS_DISTRO=foxy
FROM ros:$ROS_DISTRO
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
apt update && apt-get install --no-install-recommends -y \
gdb libusb-dev libusb-1.0-0-dev git cmake openssh-client ca-certificates make g++ automake build-essential autoconf software-properties-common libtool-bin udev \
ros-$ROS_DISTRO-cv-bridge-dbgsym ros-$ROS_DISTRO-image-transport-dbgsym ros-$ROS_DISTRO-vision-msgs libyaml-cpp-dev ros-$ROS_DISTRO-camera-info-manager-dbgsym ros-$ROS_DISTRO-rqt-* ros-$ROS_DISTRO-demo-nodes-cpp
RUN update-ca-certificates
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
RUN git clone -v https://github.com/libusb/libusb.git /repos/libusb && \
cd /repos/libusb && git fetch && \
git reset --hard master && \
cd /repos/libusb && ./autogen.sh --disable-udev && make install && \
rm -rf /repos/libusb
ADD https://api.github.com/repos/constructiverealities/depthai/branches/cr/develop cache-check
RUN git clone -b cr/develop https://github.com/constructiverealities/depthai.git --recursive /repos/depthai_core && \
mkdir -p /build/depthai-core/cr/develop && \
cd /build/depthai-core/cr/develop && cmake -DDEPTHAI_BUILD_EXAMPLES=OFF -DDEPTHAI_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=On /repos/depthai_core && make -j4 install && \
rm -rf /build /repos/depthai_core
ADD . /ros_ws/src/cr-dai-tools
SHELL ["/bin/bash", "-c"]
ENV PYTHONUNBUFFERED 1
RUN source /opt/ros/$ROS_DISTRO/setup.bash && cd /ros_ws && colcon --log-level info build --merge-install --install-base /opt/ros/$ROS_DISTRO --cmake-args -DROS_BUILD=ON
ENV ROS_DISTRO=$ROS_DISTRO
ADD entrypoint.sh /
RUN groupadd --gid 1000 cr-user && useradd --uid 1000 --gid cr-user --shell /bin/bash --create-home cr-user
USER 1000:1000
ENV LD_LIBRARY_PATH=/opt/ros/foxy/lib/x86_64-linux-gnu/:/opt/ros/foxy/lib/
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/opt/ros/foxy/bin/autonode"]