Fix permission issue when you use PV for rootless dind cache (#1977)

* Fix permission issue when you use PV for rootless dind cache

This fixes the said issue I have found while testing #1759.

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
This commit is contained in:
Yusuke Kuoka
2022-11-04 06:46:21 +09:00
committed by GitHub
parent 2ac48038c6
commit 63e8f32281

View File

@@ -22,6 +22,17 @@ jq ".\"registry-mirrors\"[0] = \"${DOCKER_REGISTRY_MIRROR}\"" /home/runner/.conf
fi
SCRIPT
if [ -d /home/runner/.local ]; then
if [ ! -d /home/runner/.local/share ]; then
log.notice "Creating /home/runner/.local/share owned by runner:runner \
so that rootless dockerd will not fail with a permission error when creating /home/runner/.local/share/docker"
sudo mkdir /home/runner/.local/share
sudo chmod 755 /home/runner/.local/share
sudo chown runner:runner /home/runner/.local/share
fi
fi
log.notice "Starting Docker (rootless)"
dumb-init bash <<'SCRIPT' &