local-build: Fix .docker ownership before build-payload

The permissions on .docker/buildx/activity/default are regularly broken by us
passing docker.sock + $HOME/.docker to a container running as root and then
using buildx inside. Fixup ownership before executing docker commands.

Fixes: #8027
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
Jeremi Piotrowski 2023-09-22 13:38:49 +02:00
parent a5338e885e
commit 15425a2b80

View File

@ -25,6 +25,8 @@ arch=$(uname -m)
[ "$arch" = "x86_64" ] && arch="amd64" [ "$arch" = "x86_64" ] && arch="amd64"
IMAGE_TAG="${REGISTRY}:kata-containers-$(git rev-parse HEAD)-${arch}" IMAGE_TAG="${REGISTRY}:kata-containers-$(git rev-parse HEAD)-${arch}"
sudo chown -R $USER $HOME/.docker
echo "Building the image" echo "Building the image"
docker build --tag ${IMAGE_TAG} . docker build --tag ${IMAGE_TAG} .