[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 Ying Xie
parent a4cfe25d3d
commit bd3572ea17

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 := ,
@ -389,7 +390,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