From 864635c3604df13a0c372a1e7e3a657634bb1ff3 Mon Sep 17 00:00:00 2001 From: Chris Kim <30601846+Oats87@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:36:13 -0700 Subject: [PATCH] use bci-base to run zypper then layer the result onto bci-micro (#194) Signed-off-by: Chris Kim --- package/Dockerfile | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/package/Dockerfile b/package/Dockerfile index 65119fe5..d06e9d79 100644 --- a/package/Dockerfile +++ b/package/Dockerfile @@ -1,6 +1,22 @@ -FROM registry.suse.com/bci/bci-micro:15.6 +FROM registry.suse.com/bci/bci-micro:15.6 AS final -RUN zypper in -y openssl patterns-base-fips +# Temporary build stage image +FROM registry.suse.com/bci/bci-base:15.6 AS builder + +# Install system packages using builder image that has zypper +COPY --from=final / /chroot/ + +RUN zypper refresh && \ + zypper --installroot /chroot -n in --no-recommends \ + openssl patterns-base-fips && \ + zypper --installroot /chroot clean -a && \ + rm -rf /chroot/var/cache/zypp/* /chroot/var/log/zypp/* /chroot/tmp/* /chroot/var/tmp/* /chroot/usr/share/doc/packages/* + +# Main stage using bci-micro as the base image +FROM final + +# Copy binaries and configuration files from builder to micro +COPY --from=builder /chroot/ / COPY bin/rancher-system-agent /usr/bin/ RUN chmod +x /usr/bin/rancher-system-agent