Use podman instead of rkt, for extracting toolbox

Need to create and mount a dummy container, to get at image.

Used rsync instead of cp -pR, easier with sudo permissions.
pull/3946/head
Anders F Björklund 2019-03-23 22:15:49 +01:00
parent 702d471308
commit 3d483b292c
1 changed files with 7 additions and 3 deletions

View File

@ -50,9 +50,13 @@ if [ ! -f "${osrelease}" ] || systemctl is-failed -q "${machinename}" ; then
sudo chown "${USER}:" "${machinepath}"
if [[ -n "${have_docker_image}" ]]; then
riid=$(sudo --preserve-env rkt --insecure-options=image fetch "docker://${TOOLBOX_DOCKER_IMAGE}:${TOOLBOX_DOCKER_TAG}")
sudo --preserve-env rkt image extract --overwrite --rootfs-only "${riid}" "${machinepath}"
sudo --preserve-env rkt image rm "${riid}"
piid=$(sudo --preserve-env podman pull "docker://${TOOLBOX_DOCKER_IMAGE}:${TOOLBOX_DOCKER_TAG}")
pcid=$(sudo --preserve-env podman create "${piid}")
mnt=$(sudo --preserve-env podman mount "${pcid}")
sudo --preserve-env rsync -ax "${mnt}"/ "${machinepath}"/
sudo --preserve-env podman unmount "${pcid}"
sudo --preserve-env podman rm "${pcid}"
sudo --preserve-env podman rmi "${piid}"
else
echo "Error: No toolbox filesystem specified." >&2
exit 1