Skip to content

Commit 5e4e20a

Browse files
authored
base: remove unused packages (#5368)
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
1 parent 501b4e8 commit 5e4e20a

File tree

1 file changed

+32
-29
lines changed

1 file changed

+32
-29
lines changed

dist/images/Dockerfile.base

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -199,31 +199,34 @@ ARG ARCH
199199
ARG DEBIAN_FRONTEND=noninteractive
200200
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
201201
--mount=type=cache,target=/var/lib/apt,sharing=locked \
202-
apt update && apt upgrade -y && apt install ca-certificates python3 hostname libunwind8 netbase \
203-
ethtool iproute2 ncat libunbound8 procps libatomic1 kmod iptables python3-netifaces python3-sortedcontainers \
204-
tcpdump ipvsadm ipset curl uuid-runtime openssl inetutils-ping arping ndisc6 conntrack traceroute iputils-tracepath \
205-
logrotate dnsutils net-tools strongswan strongswan-pki libcharon-extra-plugins libmnl0 \
206-
libcharon-extauth-plugins libstrongswan-extra-plugins libstrongswan-standard-plugins -y --no-install-recommends && \
207-
setcap CAP_NET_ADMIN+eip $(readlink -f $(which conntrack)) && \
208-
setcap CAP_NET_ADMIN+eip $(readlink -f $(which ethtool)) && \
209-
setcap CAP_NET_ADMIN+eip $(readlink -f $(which ip)) && \
210-
setcap CAP_NET_ADMIN+eip $(readlink -f $(which ipset)) && \
211-
setcap CAP_NET_ADMIN+eip $(readlink -f $(which traceroute)) && \
212-
setcap CAP_NET_ADMIN,CAP_NET_RAW+eip $(readlink -f $(which xtables-legacy-multi)) && \
213-
setcap CAP_NET_ADMIN,CAP_NET_RAW+eip $(readlink -f $(which xtables-nft-multi)) && \
214-
setcap CAP_NET_RAW+eip $(readlink -f $(which arping)) && \
215-
setcap CAP_NET_RAW+eip $(readlink -f $(which ndisc6)) && \
216-
setcap CAP_NET_RAW+eip $(readlink -f $(which tcpdump)) && \
217-
setcap CAP_SYS_ADMIN+eip $(readlink -f $(which nsenter)) && \
218-
setcap CAP_SYS_ADMIN+eip $(readlink -f $(which sysctl)) && \
219-
setcap CAP_SYS_MODULE+eip $(readlink -f $(which modprobe)) && \
220-
setcap CAP_SYS_NICE+eip $(readlink -f $(which nice)) && \
221-
rm -rf /var/lib/apt/lists/* && \
222-
rm -rf /etc/localtime && \
223-
rm -f /usr/bin/nc && \
224-
rm -f /usr/bin/netcat && \
225-
rm -f /usr/lib/apt/methods/mirror && \
226-
deluser sync
202+
apt update && apt upgrade -y && \
203+
apt install ca-certificates hostname netbase ethtool iproute2 ncat libunbound8 procps \
204+
kmod iptables python3-netifaces python3-sortedcontainers tcpdump ipvsadm ipset curl \
205+
uuid-runtime openssl inetutils-ping arping ndisc6 conntrack traceroute iputils-tracepath \
206+
logrotate dnsutils net-tools strongswan strongswan-pki libcharon-extra-plugins \
207+
libcharon-extauth-plugins libstrongswan-extra-plugins libstrongswan-standard-plugins \
208+
-y --no-install-recommends --auto-remove && \
209+
apt remove -y --allow-remove-essential --auto-remove login && \
210+
setcap CAP_NET_ADMIN+eip $(readlink -f $(which conntrack)) && \
211+
setcap CAP_NET_ADMIN+eip $(readlink -f $(which ethtool)) && \
212+
setcap CAP_NET_ADMIN+eip $(readlink -f $(which ip)) && \
213+
setcap CAP_NET_ADMIN+eip $(readlink -f $(which ipset)) && \
214+
setcap CAP_NET_ADMIN+eip $(readlink -f $(which traceroute)) && \
215+
setcap CAP_NET_ADMIN,CAP_NET_RAW+eip $(readlink -f $(which xtables-legacy-multi)) && \
216+
setcap CAP_NET_ADMIN,CAP_NET_RAW+eip $(readlink -f $(which xtables-nft-multi)) && \
217+
setcap CAP_NET_RAW+eip $(readlink -f $(which arping)) && \
218+
setcap CAP_NET_RAW+eip $(readlink -f $(which ndisc6)) && \
219+
setcap CAP_NET_RAW+eip $(readlink -f $(which tcpdump)) && \
220+
setcap CAP_SYS_ADMIN+eip $(readlink -f $(which nsenter)) && \
221+
setcap CAP_SYS_ADMIN+eip $(readlink -f $(which sysctl)) && \
222+
setcap CAP_SYS_MODULE+eip $(readlink -f $(which modprobe)) && \
223+
setcap CAP_SYS_NICE+eip $(readlink -f $(which nice)) && \
224+
rm -rf /var/lib/apt/lists/* && \
225+
rm -rf /etc/localtime && \
226+
rm -f /usr/bin/nc && \
227+
rm -f /usr/bin/netcat && \
228+
rm -f /usr/lib/apt/methods/mirror && \
229+
deluser sync
227230

228231
RUN mkdir -p /var/run/openvswitch && \
229232
mkdir -p /var/run/ovn && \
@@ -244,18 +247,18 @@ RUN --mount=type=bind,target=/packages,from=ovs-builder,source=/packages \
244247
cp /packages/bfdd-beacon /packages/bfdd-control /usr/bin/ && \
245248
cp /packages/ovs-sandbox /usr/bin/ && chmod +x /usr/bin/ovs-sandbox && \
246249
setcap CAP_NET_BIND_SERVICE+eip /usr/bin/bfdd-beacon && \
247-
dpkg -i /packages/openvswitch-*.deb /packages/python3-openvswitch*.deb && \
248-
dpkg -i --ignore-depends=openvswitch-switch,openvswitch-common /packages/ovn-*.deb && \
250+
dpkg -i /packages/openvswitch-*.deb /packages/python3-openvswitch*.deb /packages/ovn-*.deb && \
249251
rm -rf /var/lib/openvswitch/pki/ && \
250252
chown -R nobody: /var/lib/logrotate && \
251253
setcap CAP_NET_ADMIN+eip $(readlink -f $(which ovs-dpctl)) && \
252254
if [ "${DEBUG}" != "true" ]; then \
253255
setcap CAP_NET_BIND_SERVICE+eip $(readlink -f $(which ovsdb-server)) && \
254-
setcap CAP_NET_ADMIN,CAP_NET_BIND_SERVICE,CAP_SYS_ADMIN+eip $(readlink -f $(which ovs-vswitchd)); \
256+
setcap CAP_NET_ADMIN,CAP_NET_BIND_SERVICE,CAP_SYS_ADMIN+eip $(readlink -f $(which ovs-vswitchd)) && \
257+
dpkg --purge gpgv apt; \
255258
else \
256259
apt update && apt install -y --no-install-recommends gdb valgrind && \
257260
rm -rf /var/lib/apt/lists/* && \
258-
dpkg -i --ignore-depends=openvswitch-switch,openvswitch-common /packages/*.ddeb; \
261+
dpkg -i /packages/*.ddeb; \
259262
fi
260263

261264
RUN --mount=type=bind,target=/packages,from=openssl-builder,source=/packages \

0 commit comments

Comments
 (0)