# syntax=docker.io/docker/dockerfile:1 # HereDoc (EOF) feature (avoids needing `&& \`) requires BuildKit: # https://docs.docker.com/engine/reference/builder/#here-documents ARG LEAP_VERSION=15.4 ARG CACHE_ZYPPER=/tmp/cache/zypper ARG INSTALL_ROOT=/rootfs FROM opensuse/leap:${LEAP_VERSION} as builder ARG CACHE_ZYPPER ARG INSTALL_ROOT # --mount is only necessary for persisting the zypper cache on the build host, # Paired with --cache-dir below, RUN layer invalidation does not clear this cache. # Not useful for CI, only local builds that retain the storage. RUN --mount=type=cache,target="${CACHE_ZYPPER}",sharing=locked <