Skip to content

Commit 4ac2ba6

Browse files
authored
fix(dockerfile): Avoid autoremove removing runtime deps (#68)
1 parent de6b050 commit 4ac2ba6

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3636
libatlas-base-dev \
3737
libsuitesparse-dev \
3838
libceres-dev \
39-
ros-$ROS_DISTRO-rviz2 \
40-
ros-$ROS_DISTRO-foxglove-bridge \
39+
ros-$ROS_DISTRO-rviz2 ros-$ROS_DISTRO-foxglove-bridge \
4140
ros-$ROS_DISTRO-pcl-ros ros-$ROS_DISTRO-pcl-conversions ros-$ROS_DISTRO-pcl-msgs \
4241
ros-$ROS_DISTRO-navigation2 ros-$ROS_DISTRO-nav2-msgs \
4342
lua5.4 liblua5.4-0 liblua5.4-dev && \
44-
apt-get autoremove -y && apt-get clean && \
43+
apt-get clean && \
4544
rm -rf /var/lib/apt/lists/* /tmp/*
4645

4746

@@ -55,7 +54,7 @@ RUN if [ "${TARGETARCH}" = "amd64" ]; then \
5554
> /etc/apt/sources.list.d/intel-openvino.list && \
5655
apt-get update && \
5756
apt-get install -y --no-install-recommends openvino-2025.2.0 && \
58-
apt-get autoremove -y && apt-get clean && \
57+
apt-get clean && \
5958
rm -rf /var/lib/apt/lists/* /tmp/*; \
6059
else \
6160
echo "Skipping OpenVINO install on ${TARGETARCH}"; \
@@ -75,7 +74,7 @@ RUN git clone https://github.com/Livox-SDK/Livox-SDK2.git && \
7574
RUN --mount=type=bind,target=/rmcs_ws/src,source=rmcs_ws/src,readonly \
7675
apt-get update && \
7776
rosdep install --from-paths /rmcs_ws/src --ignore-src -r -y && \
78-
apt-get autoremove -y && apt-get clean && \
77+
apt-get clean && \
7978
rm -rf /var/lib/apt/lists/* /tmp/*
8079

8180
# Build Unison from source because upstream does not ship arm64 release binaries
@@ -110,13 +109,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
110109
python3-colorama python3-dpkt && \
111110
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 50 && \
112111
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50 && \
113-
apt-get autoremove -y && apt-get clean && \
112+
apt-get clean && \
114113
rm -rf /var/lib/apt/lists/* /tmp/*
115114

116115
# Install Node.js 24 LTS (required by agent CLIs)
117116
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - && \
118117
apt-get install -y --no-install-recommends nodejs && \
119-
apt-get autoremove -y && apt-get clean && \
118+
apt-get clean && \
120119
rm -rf /var/lib/apt/lists/* /tmp/*
121120

122121
# Install llvm-toolchain
@@ -140,7 +139,7 @@ RUN mkdir -p /etc/apt/keyrings && \
140139
update-alternatives --install /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-${LLVM_VERSION} 50 && \
141140
update-alternatives --install /usr/bin/llvm-ranlib llvm-ranlib /usr/bin/llvm-ranlib-${LLVM_VERSION} 50 && \
142141
update-alternatives --install /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-${LLVM_VERSION} 50 && \
143-
apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
142+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
144143

145144
# Generate/load ssh key and setup unison
146145
RUN --mount=type=bind,target=/tmp/.ssh,source=.ssh,readonly=false \
@@ -223,7 +222,7 @@ RUN apt-get update && \
223222
"binutils-${cross_pkg_triplet}" && \
224223
update-alternatives --install "/usr/bin/${cross_triplet}-gcc" "${cross_triplet}-gcc" "/usr/bin/${cross_triplet}-gcc-14" 50 && \
225224
update-alternatives --install "/usr/bin/${cross_triplet}-g++" "${cross_triplet}-g++" "/usr/bin/${cross_triplet}-g++-14" 50 && \
226-
apt-get autoremove -y && apt-get clean && \
225+
apt-get clean && \
227226
rm -rf /var/lib/apt/lists/* /tmp/*
228227

229228
RUN mkdir -p /opt/sysroots && \
@@ -266,7 +265,7 @@ FROM rmcs-base AS rmcs-runtime
266265
# Install runtime tools
267266
RUN apt-get update && \
268267
apt-get install -y --no-install-recommends tini openssh-server avahi-daemon orphan-sysvinit-scripts && \
269-
apt-get autoremove -y && apt-get clean && \
268+
apt-get clean && \
270269
rm -rf /var/lib/apt/lists/* /tmp/* && \
271270
echo 'Port 2022' >> /etc/ssh/sshd_config && \
272271
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \

0 commit comments

Comments
 (0)