Skip to content

Commit 2848261

Browse files
committed
Check the DID user is in the docker group
Signed-off-by: Elizabeth Byerly <ebyerly@google.com>
1 parent a200492 commit 2848261

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ci/docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ x-envoy-build-base: &envoy-build-base
9797
chown envoybuild:envoybuild /build
9898
chown envoybuild /proc/self/fd/2 2>/dev/null || true
9999
[[ -e /entrypoint-extra.sh ]] && /entrypoint-extra.sh
100+
101+
if [ -S /var/run/docker.sock ]; then
102+
DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
103+
if ! getent group "$DOCKER_GID" >/dev/null; then
104+
groupadd -g "$DOCKER_GID" docker_sock
105+
fi
106+
usermod -a -G "$(getent group "$DOCKER_GID" | cut -d: -f1)" envoybuild
107+
fi
108+
100109
sudo -EHs -u envoybuild bash -c 'cd ${ENVOY_DOCKER_SOURCE_DIR:-/source} && exec ${DOCKER_COMMAND:-bash}'
101110
102111
services:

0 commit comments

Comments
 (0)