worked for me. when I added “nameserver 8.8.8.8” to /etc/resolv.conf
I experienced the same problem on my side and resolved it by running this command:
sudo usermod -a -G docker <your_username>
I installed my docker desktop manually on my windows machine using the WSL config but I wanted to run my docker commands on a linux terminal. the simple solution for me was to run that command to solve for that error.
I added “nameserver 8.8.8.8” to /etc/resolv.conf, then login via terminal succeeded on my MacOS.