Overview

When trying sam local invoke with AWS SAM, the following message was displayed.

Error: Running AWS SAM projects locally requires Docker. Have you got it installed and running?

The environment was Mac, and Docker was running.

Solution

Running the following command resolved the issue.

sudo ln -s ~/.docker/run/docker.sock /var/run/docker.sock

I referenced the following.

https://github.com/lando/lando/issues/3533

Summary

I hope this is helpful for anyone facing the same issue.