From 718eb3461c3ebf12e3c458444fbd6e02aea63232 Mon Sep 17 00:00:00 2001 From: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Date: Wed, 22 Mar 2023 21:31:34 +1300 Subject: [PATCH] chore: Revise `Dockerfile` - Removing bulk of the noise from inline documentation. - Packages bundled into single line like previous the Alpine version had. - `CACHE_ZYPPER` is only used as an `ARG` in the `builder` stage. - `zypper clean` wasn't able to clear anything from the install root, other than the `CACHE_ZYPPER` mount. --- Dockerfile | 47 ++++++++--------------------------------------- 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/Dockerfile b/Dockerfile index d5749a9..c041ccb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,66 +1,35 @@ # 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 CACHE_ZYPPER=/tmp/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 <