AWS Lambda Sam can't find docker
Follow these steps:
- Delete the
~/.docker
directory - Create the "docker" group
- Add my user to the "docker" group
- Logout and back in again
- Restart the "docker" daemon.
More info in the Docker postinstall instructions
I had an older version of docker installed. Although docker was working fine, sam could not detect it properly.
sam local start-api --debug
docker.errors.APIError: 400 Client Error: Bad Request ("client is newer than server (client API version: 1.35, server API version: 1.24)") Error: Running AWS SAM projects locally requires Docker. Have you got it installed?
I removed the old version and re-installed the docker.io package (under Ubuntu). Then I started the docker daemon and the issue was fixed.
When installing Docker in windows make sure to install the linux kernel update that you get from a prompt window after installation:
After the update has been installed docker should restart (otherwise restart manually, or restart computer) and SAM should be able to find it ok.