Skip to content

Instantly share code, notes, and snippets.

@thomashartm
Last active June 20, 2024 11:37
Show Gist options
  • Save thomashartm/9d48aa8d9fad98ee06c368bd416d1f08 to your computer and use it in GitHub Desktop.
Save thomashartm/9d48aa8d9fad98ee06c368bd416d1f08 to your computer and use it in GitHub Desktop.
Enable AWS SAM local to run without Docker Desktop but Colima + Docker Daemon on MacOs

AWS SAM local commands without Docker Desktop

AWS SAM local commands check for the existance of DOCKER_HOST. If the variable is not present, it will fail with the following error message

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

Replace it with Colima

Point DOCKER_HOST to unix socket of the Docker Daemon. Colina creates it in the $HOME/.colima directory. Check the folder if the unix socket is present (docker.sock)

ls -la $HOME/.colima 

Now set the environment variable (better add it to your shell config in .zshenv)

export DOCKER_HOST="unix://$HOME/.colima/docker.sock"

Source it in your shell

source ~/.zshenv

Now rebuild your sam project

sam build -u
@hakumushi
Copy link

THANK YOU VERY MUCH!!!!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment