Fix Stale Docker Group Membership
Diagnosis for “user does not have permission to launch docker” when
you’re already supposedly in the docker group.
Check what the shell sees vs. what the system records
groups # what groups the current shell sees
id # same, more detail
getent group docker # what the system actually recordsIf groups/id do not show docker but getent group docker
does list you, it’s a stale session — group changes only apply to new
shells and logins.
ls -la /var/run/docker.sockShould show docker as the group owner. root means the daemon isn’t
configured for the group at all — a different problem.
Fix
newgrp dockerRefreshes group membership in the current shell without a full logout/login.
VS Code caveat
VS Code’s background server process (~/.vscode-server) holds the old
group list independently of your terminal. Running newgrp in a
terminal will not fix it — needs a full quit and relaunch (not just a
window reload), or a reboot.