From f67c6d1e477ba546c5e85fbc84bfd81937827895 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 6 Oct 2026 23:05:19 +0300 Subject: [PATCH 1/3] [docker-outside-of-docker] - The socat branch no longer executes after the container restarts if the Docker GID has been changed The DOCKER_GID variable must be defined every time the container starts; otherwise, after the Docker GID is changed via `sudoIf groupmod --gid "\${SOCKET_GID}" docker`, the socat fallback will trigger on subsequent restarts. --- src/docker-outside-of-docker/install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/docker-outside-of-docker/install.sh b/src/docker-outside-of-docker/install.sh index 2a1515565..bf052f70d 100755 --- a/src/docker-outside-of-docker/install.sh +++ b/src/docker-outside-of-docker/install.sh @@ -462,8 +462,6 @@ if [ "${ENABLE_NONROOT_DOCKER}" = "false" ] || [ "${USERNAME}" = "root" ]; then exit 0 fi -DOCKER_GID="$(grep -oP '^docker:x:\K[^:]+' /etc/group)" - # If enabling non-root access and specified user is found, setup socat and add script chown -h "${USERNAME}":root "${TARGET_SOCKET}" check_packages socat @@ -504,8 +502,11 @@ log "Ensuring ${USERNAME} has access to ${SOURCE_SOCKET} via ${TARGET_SOCKET}" # fall back on using socat to forward the docker socket to another unix socket so # that we can set permissions on it without affecting the host. if [ "${ENABLE_NONROOT_DOCKER}" = "true" ] && [ "${SOURCE_SOCKET}" != "${TARGET_SOCKET}" ] && [ "${USERNAME}" != "root" ] && [ "${USERNAME}" != "0" ]; then + DOCKER_GID="\$(getent group docker | cut -d: -f3)" SOCKET_GID=\$(stat -c '%g' ${SOURCE_SOCKET}) - if [ "\${SOCKET_GID}" != "0" ] && [ "\${SOCKET_GID}" != "${DOCKER_GID}" ] && ! grep -E ".+:x:\${SOCKET_GID}" /etc/group; then + if [ "\${SOCKET_GID}" = "\${DOCKER_GID}" ]; then + log "Docker group matches socket GID \${SOCKET_GID}, nothing to do" + if [ "\${SOCKET_GID}" != "0" ] && ! getent group "\${SOCKET_GID}" > /dev/null; then sudoIf groupmod --gid "\${SOCKET_GID}" docker else # Enable proxy if not already running From 8d08c5c416576948d4f3bd7c2017e13d4aa33c81 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 12 Oct 2026 23:44:25 +0300 Subject: [PATCH 2/3] fixed a syntax error --- src/docker-outside-of-docker/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docker-outside-of-docker/install.sh b/src/docker-outside-of-docker/install.sh index bf052f70d..a7738f2e2 100755 --- a/src/docker-outside-of-docker/install.sh +++ b/src/docker-outside-of-docker/install.sh @@ -506,7 +506,7 @@ if [ "${ENABLE_NONROOT_DOCKER}" = "true" ] && [ "${SOURCE_SOCKET}" != "${TARGET_ SOCKET_GID=\$(stat -c '%g' ${SOURCE_SOCKET}) if [ "\${SOCKET_GID}" = "\${DOCKER_GID}" ]; then log "Docker group matches socket GID \${SOCKET_GID}, nothing to do" - if [ "\${SOCKET_GID}" != "0" ] && ! getent group "\${SOCKET_GID}" > /dev/null; then + elif [ "\${SOCKET_GID}" != "0" ] && ! getent group "\${SOCKET_GID}" > /dev/null; then sudoIf groupmod --gid "\${SOCKET_GID}" docker else # Enable proxy if not already running From 2e4ae99d47efab25740449c31fb03b85e1e8dd31 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 12 Oct 2026 23:52:33 +0300 Subject: [PATCH 3/3] Update docker-outside-of-docker version to 1.10.2 --- src/docker-outside-of-docker/devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docker-outside-of-docker/devcontainer-feature.json b/src/docker-outside-of-docker/devcontainer-feature.json index 9ab361cd6..7ebbd4783 100644 --- a/src/docker-outside-of-docker/devcontainer-feature.json +++ b/src/docker-outside-of-docker/devcontainer-feature.json @@ -1,7 +1,7 @@ { "id": "docker-outside-of-docker", - "version": "1.10.1", + "version": "1.10.2", "name": "Docker (docker-outside-of-docker)", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-outside-of-docker", "description": "Re-use the host docker socket, adding the Docker CLI to a container. Feature invokes a script to enable using a forwarded Docker socket within a container to run Docker commands.",