From accf8c33e7c6b71907a3eb6cf360d8304832654e Mon Sep 17 00:00:00 2001 From: Nils Freydank Date: Sun, 22 Oct 2023 11:17:17 +0200 Subject: [PATCH] Provide the stage3 file via ARGS My distfiles path on my host does not match the one mounted into the container. Symlinks are not followed by podman, AFAICT due to security concerns. Using ARGS to change the path seems reasonable to me. --- Dockerfile | 3 ++- build-image.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 001920c..4569f50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,8 @@ FROM scratch as bootstrap # Unpack the stage3 archive (which is downloaded and verifed externally). -ADD latest-stage3.tar.xz / +ARG ROOTFS_FILENAME="" +ADD ${ROOTFS_FILENAME} / # Set the profile. RUN eselect profile set "default/linux/amd64/17.1/no-multilib/systemd/merged-usr" # Replace /etc/portage/make.conf. diff --git a/build-image.sh b/build-image.sh index 7d8d636..c0a346d 100755 --- a/build-image.sh +++ b/build-image.sh @@ -91,6 +91,7 @@ podman tag rm "${REGISTRY}:latest" # Do not exit_err here. At least on first run # there is no latest tag to delete. # === Build the new image. -podman build "${PODMAN_BUILD_ARGS[@]}" || exit_err "Build failed." +podman build --build-arg=ROOTFS_FILENAME="${DISTFILES}/${ARCHIVE_FILE_NAME}" \ + "${PODMAN_BUILD_ARGS[@]}" || exit_err "Build failed." # vim:fileencoding=utf-8:ts=4:syntax=bash:expandtab