docker login error on m1

After updating my m1 mac, and docker, the docker login to private repo commands started to fail.

Error saving credentials: error storing credentials - err: exit status 1, out: Post "http://ipc/registry/credstore-updated": dial unix /Users/user/Library/Containers/com.docker.docker/Data/backend.sock: connect: connection refused

If you are using lima-vm, remove this line from ~/.docker/config.json

"credStore": "desktop"