For me work the command:
% sudo chmod 777 /var/run/docker.sock
And then run the commands that AWS indicates on its ECR page.