-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (36 loc) · 1.47 KB
/
Dockerfile
File metadata and controls
50 lines (36 loc) · 1.47 KB
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
# syntax=docker/dockerfile:1.4
ARG ROS_DISTRO=humble
FROM ros:${ROS_DISTRO}-ros-base
ENV TZ=Asia/Tokyo
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV DEBIAN_FRONTEND=noninteractive
RUN printf 'APT::Keep-Downloaded-Packages "true";\nBinary::apt-get::Keep-Downloaded-Packages "true";\n' > /etc/apt/apt.conf.d/99keep-cache
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
apt-get update && \
apt-get install -y \
locales \
ros-dev-tools \
git && \
locale-gen en_US en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
RUN rosdep init || true && rosdep update
ENV LANG=en_US.UTF-8
ENV ROS_DISTRO=${ROS_DISTRO}
ENV ROS_WS=/opt/ros2_ws
WORKDIR ${ROS_WS}
COPY .local/src ./src
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
set -e && \
set -o pipefail && \
source "/opt/ros/${ROS_DISTRO}/setup.bash" && \
apt-get update && \
rosdep install --from-paths src --ignore-src --rosdistro "${ROS_DISTRO}" -y && \
colcon build --merge-install --install-base install
COPY docker/entrypoint.sh /usr/local/bin/ros_ws_entrypoint.sh
RUN chmod +x /usr/local/bin/ros_ws_entrypoint.sh
ENV COLCON_CURRENT_PREFIX=${ROS_WS}/install
ENTRYPOINT ["/usr/local/bin/ros_ws_entrypoint.sh"]
CMD ["bash"]