[bookworm] Fix docker gid mismatch with host (#17158)

* [bookworm] Fix docker gid mismatch with host
* Use group-add arg instead of update sonic-slave user

Signed-off-by: Vivek Reddy <vkarri@nvidia.com>
This commit is contained in:
Vivek 2023-11-16 17:59:55 -08:00 committed by GitHub
parent a8e4fb1aaa
commit 98fc38ebec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,6 +69,7 @@ USER := $(shell id -un)
PWD := $(shell pwd)
USER_LC := $(shell echo $(USER) | tr A-Z a-z)
DOCKER_MACHINE := $(shell docker run --rm debian:buster uname -m)
HOST_DOCKERD_GID := $(shell getent group docker | cut -d : -f3)
comma := ,
@ -387,7 +388,7 @@ endif
ifeq ($(SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD), y)
ifneq ($(MULTIARCH_QEMU_ENVIRON), y)
DOCKER_RUN += -v /var/run/docker.sock:/var/run/docker.sock
DOCKER_RUN += -v /var/run/docker.sock:/var/run/docker.sock --group-add $(HOST_DOCKERD_GID)
endif
endif