From 6cc68abbdb9ad0e0327b8eb29db6fd092cdda836 Mon Sep 17 00:00:00 2001 From: Jack Lin Date: Fri, 24 Nov 2023 09:39:12 +0800 Subject: [PATCH] Merge pull request #311 * build: reduce iamge size by removing unused packages * merge master * build: remove unused pcakages * Merge branch 'master' into LH5911_reduce_longhorn_image_size * Merge branch 'master' into LH5911_reduce_longhorn_image_size --- package/Dockerfile | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/package/Dockerfile b/package/Dockerfile index cef5a708b..e2d344222 100644 --- a/package/Dockerfile +++ b/package/Dockerfile @@ -66,32 +66,35 @@ RUN git clone https://github.com/linux-nvme/nvme-cli.git ${NVME_CLI_DIR} && \ meson compile -C .build && \ meson install -C .build --destdir /usr/local/nvme -FROM registry.suse.com/bci/bci-base:15.4 AS release +# Install grpc_health_probe +RUN wget https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.3.2/grpc_health_probe-linux-${ARCH} -O /usr/local/bin/grpc_health_probe && \ + chmod +x /usr/local/bin/grpc_health_probe + +FROM registry.suse.com/bci/bci-base:15.5 AS release ARG ARCH=amd64 RUN zypper -n addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/SLE_15/system:snappy.repo && \ zypper -n addrepo --refresh https://download.opensuse.org/repositories/network:/utilities/SLE_15_SP4/network:utilities.repo && \ - zypper -n addrepo --refresh https://download.opensuse.org/repositories/devel:libraries:c_c++/15.4/devel:libraries:c_c++.repo && \ - zypper -n addrepo --refresh https://download.opensuse.org/repositories/devel:languages:python:Factory/15.4/devel:languages:python:Factory.repo && \ + zypper -n addrepo --refresh https://download.opensuse.org/repositories/devel:libraries:c_c++/15.5/devel:libraries:c_c++.repo && \ + zypper -n addrepo --refresh https://download.opensuse.org/repositories/devel:languages:python:Factory/15.5/devel:languages:python:Factory.repo && \ zypper -n addrepo --refresh https://download.opensuse.org/repositories/devel:languages:python:backports/SLE_15/devel:languages:python:backports.repo && \ zypper --gpg-auto-import-keys ref -RUN zypper -n install kmod curl fuse wget \ - nfs-client nfs4-acl-tools cifs-utils \ - libibverbs librdmacm1 rdma-core-devel perl-Config-General libaio-devel sg3_utils \ - iputils telnet iproute2 qemu-tools \ - e2fsprogs e2fsprogs-devel xfsprogs xfsprogs-devel util-linux-systemd python3 +RUN zypper -n install nfs-client nfs4-acl-tools cifs-utils sg3_utils \ + iputils iproute2 qemu-tools e2fsprogs xfsprogs util-linux-systemd python3-pyelftools libcmocka-devel && \ + rm -rf /var/cache/zypp/* # Install SPDK dependencies COPY --from=builder /usr/src/spdk/scripts /spdk/ RUN if [ "${ARCH}" == "amd64" ]; then \ sh /spdk/pkgdep.sh; \ - rm -rf /tmp/spdk; \ + rm -rf /spdk; \ fi # Copy pre-built binaries from builder COPY --from=builder \ + /usr/local/bin/grpc_health_probe \ /usr/local/bin/spdk_* \ /usr/sbin/tgt-admin \ /usr/sbin/tgt-setup-lun \ @@ -108,10 +111,6 @@ COPY --from=builder \ RUN ldconfig -# Install grpc_health_probe -RUN wget https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.21/grpc_health_probe-linux-${ARCH} -O /usr/local/bin/grpc_health_probe && \ - chmod +x /usr/local/bin/grpc_health_probe - COPY bin/longhorn-instance-manager package/instance-manager /usr/local/bin/ VOLUME /usr/local/bin