Retain /lib/apk/db for SBOM tools (#3913)

This allows SBOM tools to look at /lib/apk/db/installed to determine
which package versions are included in the container. This should
probably be applied across all of the linuxkit containers.

Signed-off-by: eriknordmark <erik@zededa.com>
This commit is contained in:
Erik Nordmark
2023-03-14 23:27:09 +01:00
committed by GitHub
parent d4a8e284f6
commit c79558cc5a
6 changed files with 11 additions and 3 deletions

View File

@@ -27,8 +27,8 @@ RUN apk add --no-cache --initdb -p /out alpine-baselayout busybox musl
# Add /etc/ssl/certs so it can be bind-mounted into metadata package
RUN mkdir -p /out/etc/ssl/certs
# Remove apk residuals. We have a read-only rootfs, so apk is of no use.
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
# Remove cache residuals. We retain apk for SBOM tools
RUN rm -rf /out/var/cache
FROM scratch
ENTRYPOINT []