Merge pull request #3946 from afbjorklund/podman-toolbox

Use podman instead of rkt, for extracting toolbox
pull/3944/head^2
Thomas Strömberg 2019-03-25 11:28:10 -07:00 committed by GitHub
commit 593c4795de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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