Skip to content

Commit

Permalink
chore(dockerfile): reduce packaging time
Browse files Browse the repository at this point in the history
The packages aren't updated frequently, so the content of the image
layer usually remains unchanged.
To avoid unnecessary rebuilding of this layer, copy the longhorn-manager
binaries after installing the packages.

Longhorn 8744

Signed-off-by: Derek Su <derek.su@suse.com>
(cherry picked from commit 201e11a)
  • Loading branch information
derekbit committed Oct 23, 2024
1 parent d319b35 commit f746ae2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ RUN if [ "$TARGETPLATFORM" != "linux/amd64" ] && [ "$TARGETPLATFORM" != "linux/a

ENV ARCH ${TARGETPLATFORM#linux/}

COPY package/bin/longhorn-manager-${ARCH} /usr/local/sbin/longhorn-manager

COPY package/launch-manager package/nsmounter /usr/local/sbin/

RUN zypper -n install iputils iproute2 nfs-client cifs-utils bind-utils e2fsprogs xfsprogs zip unzip && \
rm -rf /var/cache/zypp/*

VOLUME /usr/local/sbin

COPY package/bin/longhorn-manager-${ARCH} /usr/local/sbin/longhorn-manager

COPY package/launch-manager package/nsmounter /usr/local/sbin/

EXPOSE 9500
CMD ["launch-manager"]

0 comments on commit f746ae2

Please sign in to comment.