From 5979e3399da663fcce2e812afc2a5e3ee1ce581c Mon Sep 17 00:00:00 2001 From: Andrew Rynhard Date: Sat, 31 Oct 2020 13:55:47 -0700 Subject: [PATCH] chore: remove unused binaries Removes socat (no dependency in containerd since 1.4), and static binaries. Signed-off-by: Andrew Rynhard --- Dockerfile | 2 -- hack/cleanup.sh | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 40da8d44e..725d6e975 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,6 @@ FROM ghcr.io/talos-systems/musl:${PKGS} AS pkg-musl FROM ghcr.io/talos-systems/open-iscsi:${PKGS} AS pkg-open-iscsi FROM ghcr.io/talos-systems/open-isns:${PKGS} AS pkg-open-isns FROM ghcr.io/talos-systems/runc:${PKGS} AS pkg-runc -FROM ghcr.io/talos-systems/socat:${PKGS} AS pkg-socat FROM ghcr.io/talos-systems/xfsprogs:${PKGS} AS pkg-xfsprogs FROM ghcr.io/talos-systems/util-linux:${PKGS} AS pkg-util-linux FROM ghcr.io/talos-systems/util-linux:${PKGS} AS pkg-util-linux @@ -378,7 +377,6 @@ COPY --from=pkg-musl / /rootfs COPY --from=pkg-open-iscsi / /rootfs COPY --from=pkg-open-isns / /rootfs COPY --from=pkg-runc / /rootfs -COPY --from=pkg-socat / /rootfs COPY --from=pkg-xfsprogs / /rootfs COPY --from=pkg-util-linux /lib/libblkid.* /rootfs/lib/ COPY --from=pkg-util-linux /lib/libuuid.* /rootfs/lib/ diff --git a/hack/cleanup.sh b/hack/cleanup.sh index 91e46c37e..80d19943a 100755 --- a/hack/cleanup.sh +++ b/hack/cleanup.sh @@ -21,6 +21,8 @@ remove_symlinks # Remove any archives as we do not need them since everything is dynamically linked. find ${PREFIX} -type f -name \*.a -print0 | xargs -0 rm -rf || true find ${PREFIX} -type f -name \*.la -print0 | xargs -0 rm -rf || true +# Remove static binaries. +find ${PREFIX} -type f -name \*.static -print0 | xargs -0 rm -rf || true # Strip debug symbols from all libraries and binaries. find ${PREFIX}/{lib,usr/lib} -type f \( -name \*.so* -a ! -name \*dbg \) -exec strip --strip-unneeded {} ';' || true find ${PREFIX}/{bin,sbin,usr/bin,usr/sbin} -type f -exec strip --strip-all {} ';' || true