When attempting to run Lambda functions in CircleCI, I encountered below error
Failed to pull Docker image because Docker is not available in the LocalStack container but required to run Lambda functions. Please add the Docker volume mount
My current setup involves running LocalStack as a Docker image in a service and integrating it with my Node.js jobs to execute test cases. While SNS and SQS are functioning correctly since they don’t rely on volume mounts, Lambda is encountering issues.I noticed that in the official documentation, the recommended configuration involves using the orbs executor, which is not currently included in our configuration.
Could someone provide guidance or assistance with integrating LocalStack into our CircleCI setup to address this issue?
Our sample circleci config:
- image: circleci/mongo:4.1.13
- image: memcached:1.6.9
- image: cimg/node:20.3
- <<: *mongo
- <<: *localstack
- equal: [ build, << some conditions >> ]
Can you please try using the LocalStack Orb - localstack/platform to set up your CI pipeline?
@Marcel Thanks for the replay, I attempted to configure the LocalStack Orb - localstack/platform but encountered errors in the process. Would you be able to share functional examples involving Lambda? My intention was to utilize LocalStack for testing our existing application test cases. We need to run LocalStack as a service for our current jobs, similar to the example mentioned above.
Hi Arya — Apologies for the delayed response!
I have prepared a CircleCI config that should explain a good way of setting up LocalStack with Lambda functions: https://github.com/HarshCasper/sample-microservices-apigateway-lambda-dynamodb-sqs/blob/main/.circleci/config.yml
Here is the successful run for the CircleCI job — https://app.circleci.com/jobs/github/HarshCasper/sample-microservices-apigateway-lambda-dynamodb-sqs/4
I hope this helps! Please let me know if you are looking for an alternative job configuration.
Thanks Harsh, I appreciate your response. The provided links to your GitHub repository and the successful CircleCI job run are very helpful. I’ll definitely take a look at the config to understand how to set up LocalStack with Lambda functions in my CircleCI configuration.
I’ll let you know if I have any questions or if I’m looking for an alternative job configuration. Thanks again for your assistance!