Skip to content

Commit

Permalink
Merge pull request #311
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ChanYiLin committed Nov 24, 2023
1 parent 055db7e commit 6cc68ab
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit 6cc68ab

Please sign in to comment.