How to fix "dial unix /var/run/docker.sock: connect: permission denied" when group permissions seem correct?
sudo setfacl --modify user:<user name or ID>:rw /var/run/docker.sock
It doesn't require a restart and is more secure than usermod or chown.
as @mirekphd pointed out, the user ID is required when the user name only exists inside the container, but not on the host.