From 411888796b6365e164ddbbae90caef2cb45dbfc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 17 Oct 2022 17:16:43 +0200 Subject: [PATCH] packaging: Fix kata-deploy-binaries-in-docker.sh with podman MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instad of bailing out whenever the docker group doesn't exist, just consider podman is being used, and set the docker_gid to the user's gid. Also, let's ensure to pass `--privileged` to the container, so `/run/podman/podman.socket` (which is what `/var/run/docker.sock` points to) can be passed to the container. Signed-off-by: Fabiano FidĂȘncio --- .../kata-deploy/local-build/kata-deploy-binaries-in-docker.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh index 58da4d2d56..0b7c4b2389 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh @@ -23,7 +23,7 @@ fi # This is the gid of the "docker" group on host. In case of docker in docker builds # for some of the targets (clh builds from source), the nested container user needs to # be part of this group. -docker_gid=$(getent group docker | cut -d: -f3 || { echo >&2 "Missing docker group, docker needs to be installed" && false; }) +docker_gid=$(getent group docker | cut -d: -f3 || { echo >&2 "Missing docker group, probably podman is being used" && echo "${gid}"; }) # If docker gid is the effective group id of the user, do not pass it as # an additional group. @@ -45,6 +45,7 @@ docker build -q -t build-kata-deploy \ "${script_dir}/dockerbuild/" docker run \ + --privileged \ -v $HOME/.docker:/root/.docker \ -v /var/run/docker.sock:/var/run/docker.sock \ --user ${uid}:${gid} \