From 1392987f01b748021cda4e98cbaf8e151c2f9a32 Mon Sep 17 00:00:00 2001 From: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Date: Wed, 22 Mar 2023 21:18:36 +1300 Subject: [PATCH] refactor: Change base image from `alpine:3.17` to `opensuse/leap:15.4` --- Dockerfile | 91 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 83 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 92a42c8d..a49f3fe8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,87 @@ -FROM alpine:3.17 +# 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 -RUN apk update && \ - apk upgrade && \ - apk add bash procps drill git coreutils libidn curl socat openssl xxd && \ - rm -rf /var/cache/apk/* && \ - adduser -D -s /bin/bash testssl && \ - ln -s /home/testssl/testssl.sh /usr/local/bin/ +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 <