containerfile: fix tar extraction

Ic68e8c5b839cbc2852326747c68ef89f630f26a3 removed the sudo from the
tar extraction here, meaning that production is failing to create the
chroot.  This is hidden in testing because
DIB_CONTAINERFILE_PODMAN_ROOT is set.  Make the sudo here
unconditional.

Change-Id: I6e36e3fc65981f85fad12ea2cd10780fde9c37da
This commit is contained in:
Ian Wienand 2021-11-10 10:56:23 +11:00
parent a1debc726d
commit 3833c2e59c
2 changed files with 8 additions and 1 deletions

View File

@ -60,7 +60,9 @@ fi
${_sudo} podman build -t dib-work-image -f $DIB_CONTAINERFILE_DOCKERFILE $DIB_CONTAINER_CONTEXT
container=$(${_sudo} podman run -d dib-work-image /bin/sh)
${_sudo} podman export $container | ${_sudo} tar -C $TARGET_ROOT --numeric-owner -xf -
# NOTE(ianw) 2021-11-10 the tar must always be sudo to write out the chroot files
# as other uids
${_sudo} podman export $container | sudo tar -C $TARGET_ROOT --numeric-owner -xf -
${_sudo} podman rm $container
${_sudo} podman rmi dib-work-image

View File

@ -0,0 +1,5 @@
---
fixes:
- |
This release fixes an regression in the ``containerfile`` element
that prevented it extracting root images correctly.