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>
  • Loading branch information
derekbit committed Oct 22, 2024
1 parent 95e5391 commit 0797cea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,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 ref && \
zypper update -y

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

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 0797cea

Please sign in to comment.