@@ -6,21 +6,18 @@ ARG INSTALL_ROOT=/rootfs
66FROM opensuse/leap:${LEAP_VERSION} as builder
77ARG CACHE_ZYPPER=/tmp/cache/zypper
88ARG INSTALL_ROOT
9- # Usually you could source this from /etc/os-release
10- # Might not always match the image tag:
11- ARG VERSION_ID=15.4
12- RUN zypper --releasever "${VERSION_ID}" --installroot "${INSTALL_ROOT}" --cache-dir "${CACHE_ZYPPER}" \
13- --gpg-auto-import-keys refresh \
14- && zypper --releasever "${VERSION_ID}" --installroot "${INSTALL_ROOT}" --cache-dir "${CACHE_ZYPPER}" \
15- --non-interactive install --download-in-advance --no-recommends \
9+ # /etc/os-release provides $VERSION_ID
10+ RUN source /etc/os-release \
11+ && export ZYPPER_OPTIONS=( --releasever "${VERSION_ID}" --installroot "${INSTALL_ROOT}" --cache-dir "${CACHE_ZYPPER}" ) \
12+ && zypper "${ZYPPER_OPTIONS[@]}" --gpg-auto-import-keys refresh \
13+ && zypper "${ZYPPER_OPTIONS[@]}" --non-interactive install --download-in-advance --no-recommends \
1614 bash procps grep gawk sed coreutils busybox-util-linux busybox-vi ldns libidn2-0 socat openssl curl \
17- && zypper --releasever "${VERSION_ID}" --installroot "${INSTALL_ROOT}" --cache-dir "${CACHE_ZYPPER}" \
18- clean --all
15+ && zypper "${ZYPPER_OPTIONS[@]}" clean --all
1916# # Cleanup (reclaim approx 13 MiB):
2017# None of this content should be relevant to the container:
2118RUN rm -r "${INSTALL_ROOT}/usr/share/" {licenses,man,locale,doc,help,info}
2219# Functionality that the container doesn't need:
23- RUN rm "${INSTALL_ROOT}/usr/share/misc/termcap" \
20+ RUN rm "${INSTALL_ROOT}/usr/share/misc/termcap" \
2421 && rm -r "${INSTALL_ROOT}/usr/lib/sysimage/rpm"
2522
2623
0 commit comments