{"id":16932612,"url":"https://github.com/shogo82148/docker-lambda","last_synced_at":"2025-08-08T21:24:44.558Z","repository":{"id":37089045,"uuid":"411329256","full_name":"shogo82148/docker-lambda","owner":"shogo82148","description":"A fork of lambci/docker-lambda: Docker images and test runners that replicate the live AWS Lambda environment ","archived":false,"fork":false,"pushed_at":"2025-03-14T10:28:34.000Z","size":37415,"stargazers_count":5,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-14T11:28:49.610Z","etag":null,"topics":["aws-lambda","docker","serverless"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shogo82148.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"mhart"}},"created_at":"2021-09-28T15:03:43.000Z","updated_at":"2025-03-14T10:28:36.000Z","dependencies_parsed_at":"2023-02-14T17:15:29.953Z","dependency_job_id":"81b0fd34-377d-4a65-be5e-06a47d38a440","html_url":"https://github.com/shogo82148/docker-lambda","commit_stats":null,"previous_names":[],"tags_count":1385,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogo82148%2Fdocker-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogo82148%2Fdocker-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogo82148%2Fdocker-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogo82148%2Fdocker-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shogo82148","download_url":"https://codeload.github.com/shogo82148/docker-lambda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959409,"owners_count":20538625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","docker","serverless"],"created_at":"2024-10-13T20:47:06.304Z","updated_at":"2025-03-22T12:31:22.969Z","avatar_url":"https://github.com/shogo82148.png","language":"Dockerfile","funding_links":["https://github.com/sponsors/mhart"],"categories":[],"sub_categories":[],"readme":"# docker-lambda\n\nThis a fork of [lambci/docker-lambda].\nI forked it because it looks that [lambci/docker-lambda] is no longer maintained (at 2022-04-23).\n\nA sandboxed local environment that replicates the live [AWS Lambda]\nenvironment almost identically – including installed software and libraries,\nfile structure and permissions, environment variables, context objects and\nbehaviors – even the user and running process are the same.\n\nYou can use it for [running your functions](#run-examples) in the same strict Lambda environment,\nknowing that they'll exhibit the same behavior when deployed live. You can\nalso use it to [compile native dependencies](#build-examples) knowing that you're linking to the\nsame library versions that exist on AWS Lambda and then deploy using\nthe [AWS CLI](https://aws.amazon.com/cli/).\n\n---\n\n## Contents\n\n- [Usage](#usage)\n- [Migrate from lambci/docker-lambda](#migrate-from-lambci-docker-lambda)\n- [Run Examples](#run-examples)\n- [Build Examples](#build-examples)\n- [Using a Dockerfile to build](#using-a-dockerfile-to-build)\n- [Docker tags](#docker-tags)\n- [Environment variables](#environment-variables)\n- [Build environment](#build-environment)\n- [Questions](#questions)\n\n---\n\n## Usage\n\n### Running Lambda functions\n\nYou can run your Lambdas from local directories using the `-v` arg with\n`docker run`. You can run them in two modes: as a single execution, or as\n[an API server that listens for invoke events](#running-in-stay-open-api-mode).\nThe default is single execution mode, which outputs all logging to stderr and the result of the handler to stdout.\n\nYou mount your (unzipped) lambda code at `/var/task` and any (unzipped) layer\ncode at `/opt`, and most runtimes take two arguments – the first for the\nhandler and the second for the event, ie:\n\n```sh\ndocker run --rm \\\n  -v \u003ccode_dir\u003e:/var/task:ro,delegated \\\n  [-v \u003clayer_dir\u003e:/opt:ro,delegated] \\\n  ghcr.io/shogo82148/lambda-\u003cruntime\u003e:\u003cruntime-version\u003e \\\n  [\u003chandler\u003e] [\u003cevent\u003e]\n```\n\n(the `--rm` flag will remove the docker container once it has run, which is usually what you want,\nand the `ro,delegated` options ensure the directories are mounted read-only and have the highest performance)\n\nYou can pass environment variables (eg `-e AWS_ACCESS_KEY_ID=abcd`) to talk to live AWS services,\nor modify aspects of the runtime. See [below](#environment-variables) for a list.\n\n\u003e [!WARNING]\n\u003e public.ecr.aws/shogo82148 has been deprecated.\n\u003e It will no longer receive updates.\n\n#### Running in \"stay-open\" API mode\n\nIf you pass the environment variable `DOCKER_LAMBDA_STAY_OPEN=1` to the container, then instead of\nexecuting the event and shutting down, it will start an API server (on port 9001 by default), which\nyou can then call with HTTP following the [Lambda Invoke API](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html).\nThis allows you to make fast subsequent calls to your handler without paying the \"cold start\" penalty each time.\n\n```sh\ndocker run --rm [-d] \\\n  -e DOCKER_LAMBDA_STAY_OPEN=1 \\\n  -p 9001:9001 \\\n  -v \u003ccode_dir\u003e:/var/task:ro,delegated \\\n  [-v \u003clayer_dir\u003e:/opt:ro,delegated] \\\n  ghcr.io/shogo82148/lambda-\u003cruntime\u003e:\u003cruntime-version\u003e \\\n  [\u003chandler\u003e]\n```\n\n(the `-d` flag will start the container in detached mode, in the background)\n\nYou should then see:\n\n```sh\nLambda API listening on port 9001...\n```\n\nThen, in another terminal shell/window you can invoke your function using the [AWS CLI]\n(or any http client, like `curl`):\n\n```sh\naws lambda invoke --endpoint http://localhost:9001 --no-sign-request \\\n  --function-name myfunction --payload '{}' output.json\n```\n\n(if you're using [AWS CLI v2](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam), you'll need to add `--cli-binary-format raw-in-base64-out` to the above command)\n\nOr just:\n\n```sh\ncurl -d '{}' http://localhost:9001/2015-03-31/functions/myfunction/invocations\n```\n\nIt also supports the [documented Lambda API headers](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html)\n`X-Amz-Invocation-Type`, `X-Amz-Log-Type` and `X-Amz-Client-Context`.\n\nIf you want to change the exposed port, eg run on port 3000 on the host, use `-p 3000:9001` (then query `http://localhost:3000`).\n\nYou can change the internal Lambda API port from `9001` by passing `-e DOCKER_LAMBDA_API_PORT=\u003cport\u003e`.\nYou can also change the [custom runtime](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html#runtimes-custom-build)\nport from `9001` by passing `-e DOCKER_LAMBDA_RUNTIME_PORT=\u003cport\u003e`.\n\n#### Developing in \"stay-open\" mode\n\ndocker-lambda can watch for changes to your handler (and layer) code and restart the internal bootstrap process\nso you can always invoke the latest version of your code without needing to shutdown the container.\n\nTo enable this, pass `-e DOCKER_LAMBDA_WATCH=1` to `docker run`:\n\n```\ndocker run --rm \\\n  -e DOCKER_LAMBDA_WATCH=1 -e DOCKER_LAMBDA_STAY_OPEN=1 -p 9001:9001 \\\n  -v \"$PWD\":/var/task:ro,delegated \\\n  ghcr.io/shogo82148/lambda-java:11 handler\n```\n\nThen when you make changes to any file in the mounted directory, you'll see:\n\n```\nHandler/layer file changed, restarting bootstrap...\n```\n\nAnd the next invoke will reload your handler with the latest version of your code.\n\nNOTE: This doesn't work in exactly the same way with some of the older runtimes due to the way they're loaded. Specifically: `nodejs8.10` and earlier, `python3.6` and earlier, `dotnetcore2.1` and earlier, `java8` and `go1.x`. These runtimes will instead exit with error code 2\nwhen they are in watch mode and files in the handler or layer are changed.\n\nThat way you can use the `--restart on-failure` capabilities of `docker run` to have the container automatically restart instead.\n\nSo, for `nodejs8.10`, `nodejs6.10`, `nodejs4.3`, `python3.6`, `python2.7`, `dotnetcore2.1`, `dotnetcore2.0`, `java8` and `go1.x`, you'll\nneed to run watch mode like this instead:\n\n```\ndocker run --restart on-failure \\\n  -e DOCKER_LAMBDA_WATCH=1 -e DOCKER_LAMBDA_STAY_OPEN=1 -p 9001:9001 \\\n  -v \"$PWD\":/var/task:ro,delegated \\\n  ghcr.io/shogo82148/lambda-java:11 handler\n```\n\nWhen you make changes to any file in the mounted directory, you'll see:\n\n```\nHandler/layer file changed, restarting bootstrap...\n```\n\nAnd then the docker container will restart. See the [Docker documentation](https://docs.docker.com/engine/reference/commandline/run/#restart-policies---restart) for more details. Your terminal may get detached, but the container should still be running and the\nAPI should have restarted. You can do `docker ps` to find the container ID and then `docker attach \u003ccontainer_id\u003e` to reattach if you wish.\n\nIf none of the above strategies work for you, you can use a file-watching utility like [nodemon](https://nodemon.io/):\n\n```sh\n# npm install -g nodemon\nnodemon -w ./ -e '' -s SIGINT -x docker -- run --rm \\\n  -e DOCKER_LAMBDA_STAY_OPEN=1 -p 9001:9001 \\\n  -v \"$PWD\":/var/task:ro,delegated \\\n  ghcr.io/shogo82148/lambda-provided:al2 handler\n```\n\n### Building Lambda functions\n\nThe build images have a [number of extra system packages installed](#build-environment)\nintended for building and packaging your Lambda functions. You can run your build commands (eg, `gradle` on the java image), and then package up your function using `zip` or the\n[AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html),\nall from within the image.\n\n```sh\ndocker run [--rm] -v \u003ccode_dir\u003e:/var/task [-v \u003clayer_dir\u003e:/opt] ghcr.io/shogo82148/lambda-\u003cruntime\u003e:build-\u003cruntime-version\u003e \u003cbuild-cmd\u003e\n```\n\n## Migrate from lambci/docker-lambda\n\nReplace `lambci/lambda:\u003cruntime\u003e\u003cruntime-version\u003e` into `ghcr.io/shogo82148/lambda-\u003cruntime\u003e:\u003cruntime-version\u003e`, and `lambci/lambda:build-\u003cruntime\u003e\u003cruntime-version\u003e` into `ghcr.io/shogo82148/lambda-\u003cruntime\u003e:build-\u003cruntime-version\u003e`.\nSee [Docker tags](#docker-tags) for available tags.\n\n## Run Examples\n\n```sh\n# Test a `handler` function from an `index.js` file in the current directory on Node.js v18.x\ndocker run --rm -v \"$PWD\":/var/task:ro,delegated ghcr.io/shogo82148/lambda-nodejs:18 index.handler\n\n# Using a different file and handler, with a custom event\ndocker run --rm -v \"$PWD\":/var/task:ro,delegated ghcr.io/shogo82148/lambda-nodejs:18 app.myHandler '{\"some\": \"event\"}'\n\n# Test a `lambda_handler` function in `lambda_function.py` with an empty event on Python 3.10\ndocker run --rm -v \"$PWD\":/var/task:ro,delegated ghcr.io/shogo82148/lambda-python:3.10 lambda_function.lambda_handler\n\n# Similarly with Ruby 2.7\ndocker run --rm -v \"$PWD\":/var/task:ro,delegated ghcr.io/shogo82148/lambda-ruby:2.7 lambda_function.lambda_handler\n\n# Test on provided.al2 with a compiled handler named my_handler and a custom event\ndocker run --rm -v \"$PWD\":/var/task:ro,delegated ghcr.io/shogo82148/lambda-provided:al2 my_handler '{\"some\": \"event\"}'\n\n# Test a function from the current directory on Java 17\n# The directory must be laid out in the same way the Lambda zip file is,\n# with top-level package source directories and a `lib` directory for third-party jars\n# https://docs.aws.amazon.com/lambda/latest/dg/java-package.html\ndocker run --rm -v \"$PWD\":/var/task:ro,delegated ghcr.io/shogo82148/lambda-java:17 org.myorg.MyHandler\n\n# Test on .NET 6 given a test.dll assembly in the current directory,\n# a class named Function with a FunctionHandler method, and a custom event\ndocker run --rm -v \"$PWD\":/var/task:ro,delegated ghcr.io/shogo82148/lambda-dotnet:6 test::test.Function::FunctionHandler '{\"some\": \"event\"}'\n\n# Test with a provided.al2 runtime (assumes you have a `bootstrap` executable in the current directory)\ndocker run --rm -v \"$PWD\":/var/task:ro,delegated ghcr.io/shogo82148/lambda-provided:al2 handler '{\"some\": \"event\"}'\n\n# Test with layers (assumes your function code is in `./fn` and your layers in `./layer`)\ndocker run --rm -v \"$PWD\"/fn:/var/task:ro,delegated -v \"$PWD\"/layer:/opt:ro,delegated ghcr.io/shogo82148/lambda-nodejs:18\n\n# Run custom commands\ndocker run --rm --entrypoint node ghcr.io/shogo82148/lambda-nodejs:18 -v\n\n# For large events you can pipe them into stdin if you set DOCKER_LAMBDA_USE_STDIN\necho '{\"some\": \"event\"}' | docker run --rm -v \"$PWD\":/var/task:ro,delegated -i -e DOCKER_LAMBDA_USE_STDIN=1 ghcr.io/shogo82148/lambda-nodejs:18\n```\n\nYou can see more examples of how to build docker images and run different\nruntimes in the [examples](./examples) directory.\n\n## Build Examples\n\nTo use the build images, for compilation, deployment, etc:\n\n```sh\n# To compile native deps in node_modules\ndocker run --rm -v \"$PWD\":/var/task ghcr.io/shogo82148/lambda-nodejs:build-18 npm rebuild --build-from-source\n\n# To install defined poetry dependencies\ndocker run --rm -v \"$PWD\":/var/task ghcr.io/shogo82148/lambda-python:build-3.10 poetry install\n\n# To resolve dependencies on provided.al2 (working directory is /go/src/handler)\ndocker run --rm -v \"$PWD\":/go/src/handler ghcr.io/shogo82148/lambda-provided:build-al2 go mod download\n\n# For .NET, this will publish the compiled code to `./pub`,\n# which you can then use to run with `-v \"$PWD\"/pub:/var/task`\ndocker run --rm -v \"$PWD\":/var/task ghcr.io/shogo82148/lambda-dotnet:build-6 dotnet publish -c Release -o pub\n\n# Run custom commands on a build container\ndocker run --rm ghcr.io/shogo82148/lambda-python:build-3.10 aws --version\n\n# To run an interactive session on a build container\ndocker run -it ghcr.io/shogo82148/lambda-python:build-3.10 bash\n```\n\n## Using a Dockerfile to build\n\nCreate your own Docker image to build and deploy:\n\n```dockerfile\nFROM ghcr.io/shogo82148/lambda-nodejs:build-14\n\nENV AWS_DEFAULT_REGION us-east-1\n\nCOPY . .\n\nRUN npm install\n\nRUN zip -9yr lambda.zip .\n\nCMD aws lambda update-function-code --function-name mylambda --zip-file fileb://lambda.zip\n```\n\nAnd then:\n\n```sh\ndocker build -t mylambda .\ndocker run --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY mylambda\n```\n\n## Docker tags\n\nThese follow the Lambda runtime names:\n\n- [Node.js Runtimes](https://github.com/shogo82148/docker-lambda/pkgs/container/lambda-nodejs)\n\n  - `ghcr.io/shogo82148/lambda-nodejs:22`\n  - `ghcr.io/shogo82148/lambda-nodejs:22-arm64`\n  - `ghcr.io/shogo82148/lambda-nodejs:22-x86_64`\n  - `ghcr.io/shogo82148/lambda-nodejs:build-22`\n  - `ghcr.io/shogo82148/lambda-nodejs:build-22-arm64`\n  - `ghcr.io/shogo82148/lambda-nodejs:build-22-x86_64`\n  - `ghcr.io/shogo82148/lambda-nodejs:20`\n  - `ghcr.io/shogo82148/lambda-nodejs:20-arm64`\n  - `ghcr.io/shogo82148/lambda-nodejs:20-x86_64`\n  - `ghcr.io/shogo82148/lambda-nodejs:build-20`\n  - `ghcr.io/shogo82148/lambda-nodejs:build-20-arm64`\n  - `ghcr.io/shogo82148/lambda-nodejs:build-20-x86_64`\n  - `ghcr.io/shogo82148/lambda-nodejs:18`\n  - `ghcr.io/shogo82148/lambda-nodejs:18-arm64`\n  - `ghcr.io/shogo82148/lambda-nodejs:18-x86_64`\n  - `ghcr.io/shogo82148/lambda-nodejs:build-18`\n  - `ghcr.io/shogo82148/lambda-nodejs:build-18-arm64`\n  - `ghcr.io/shogo82148/lambda-nodejs:build-18-x86_64`\n\n- [Python Runtimes](https://github.com/shogo82148/docker-lambda/pkgs/container/shogo82148/lambda-python)\n\n  - `ghcr.io/shogo82148/lambda-python:3.13`\n  - `ghcr.io/shogo82148/lambda-python:3.13-arm64`\n  - `ghcr.io/shogo82148/lambda-python:3.13-x86_64`\n  - `ghcr.io/shogo82148/lambda-python:build-3.13`\n  - `ghcr.io/shogo82148/lambda-python:build-3.13-arm64`\n  - `ghcr.io/shogo82148/lambda-python:build-3.13-x86_64`\n  - `ghcr.io/shogo82148/lambda-python:3.12`\n  - `ghcr.io/shogo82148/lambda-python:3.12-arm64`\n  - `ghcr.io/shogo82148/lambda-python:3.12-x86_64`\n  - `ghcr.io/shogo82148/lambda-python:build-3.12`\n  - `ghcr.io/shogo82148/lambda-python:build-3.12-arm64`\n  - `ghcr.io/shogo82148/lambda-python:build-3.12-x86_64`\n  - `ghcr.io/shogo82148/lambda-python:3.11`\n  - `ghcr.io/shogo82148/lambda-python:3.11-arm64`\n  - `ghcr.io/shogo82148/lambda-python:3.11-x86_64`\n  - `ghcr.io/shogo82148/lambda-python:build-3.11`\n  - `ghcr.io/shogo82148/lambda-python:build-3.11-arm64`\n  - `ghcr.io/shogo82148/lambda-python:build-3.11-x86_64`\n  - `ghcr.io/shogo82148/lambda-python:3.10`\n  - `ghcr.io/shogo82148/lambda-python:3.10-arm64`\n  - `ghcr.io/shogo82148/lambda-python:3.10-x86_64`\n  - `ghcr.io/shogo82148/lambda-python:build-3.10`\n  - `ghcr.io/shogo82148/lambda-python:build-3.10-arm64`\n  - `ghcr.io/shogo82148/lambda-python:build-3.10-x86_64`\n  - `ghcr.io/shogo82148/lambda-python:3.9`\n  - `ghcr.io/shogo82148/lambda-python:3.9-arm64`\n  - `ghcr.io/shogo82148/lambda-python:3.9-x86_64`\n  - `ghcr.io/shogo82148/lambda-python:build-3.9`\n  - `ghcr.io/shogo82148/lambda-python:build-3.9-arm64`\n  - `ghcr.io/shogo82148/lambda-python:build-3.9-x86_64`\n  - `ghcr.io/shogo82148/lambda-python:3.8`\n  - `ghcr.io/shogo82148/lambda-python:3.8-arm64`\n  - `ghcr.io/shogo82148/lambda-python:3.8-x86_64`\n  - `ghcr.io/shogo82148/lambda-python:build-3.8`\n  - `ghcr.io/shogo82148/lambda-python:build-3.8-arm64`\n  - `ghcr.io/shogo82148/lambda-python:build-3.8-x86_64`\n\n- [Ruby Runtimes](https://github.com/shogo82148/docker-lambda/pkgs/container/shogo82148/lambda-ruby)\n\n  - `ghcr.io/shogo82148/lambda-ruby:3.3`\n  - `ghcr.io/shogo82148/lambda-ruby:3.3-arm64`\n  - `ghcr.io/shogo82148/lambda-ruby:3.3-x86_64`\n  - `ghcr.io/shogo82148/lambda-ruby:build-3.3`\n  - `ghcr.io/shogo82148/lambda-ruby:build-3.3-arm64`\n  - `ghcr.io/shogo82148/lambda-ruby:build-3.3-x86_64`\n  - `ghcr.io/shogo82148/lambda-ruby:3.2`\n  - `ghcr.io/shogo82148/lambda-ruby:3.2-arm64`\n  - `ghcr.io/shogo82148/lambda-ruby:3.2-x86_64`\n  - `ghcr.io/shogo82148/lambda-ruby:build-3.2`\n  - `ghcr.io/shogo82148/lambda-ruby:build-3.2-arm64`\n  - `ghcr.io/shogo82148/lambda-ruby:build-3.2-x86_64`\n\n- [Java Runtimes](https://github.com/shogo82148/docker-lambda/pkgs/container/shogo82148/lambda-java)\n\n  - `ghcr.io/shogo82148/lambda-java:21`\n  - `ghcr.io/shogo82148/lambda-java:21-arm64`\n  - `ghcr.io/shogo82148/lambda-java:21-x86_64`\n  - `ghcr.io/shogo82148/lambda-java:build-21`\n  - `ghcr.io/shogo82148/lambda-java:build-21-arm64`\n  - `ghcr.io/shogo82148/lambda-java:build-21-x86_64`\n  - `ghcr.io/shogo82148/lambda-java:17`\n  - `ghcr.io/shogo82148/lambda-java:17-arm64`\n  - `ghcr.io/shogo82148/lambda-java:17-x86_64`\n  - `ghcr.io/shogo82148/lambda-java:build-17`\n  - `ghcr.io/shogo82148/lambda-java:build-17-arm64`\n  - `ghcr.io/shogo82148/lambda-java:build-17-x86_64`\n  - `ghcr.io/shogo82148/lambda-java:11`\n  - `ghcr.io/shogo82148/lambda-java:11-arm64`\n  - `ghcr.io/shogo82148/lambda-java:11-x86_64`\n  - `ghcr.io/shogo82148/lambda-java:build-11`\n  - `ghcr.io/shogo82148/lambda-java:build-11-arm64`\n  - `ghcr.io/shogo82148/lambda-java:build-11-x86_64`\n  - `ghcr.io/shogo82148/lambda-java:8.al2`\n  - `ghcr.io/shogo82148/lambda-java:8.al2-arm64`\n  - `ghcr.io/shogo82148/lambda-java:8.al2-x86_64`\n  - `ghcr.io/shogo82148/lambda-java:build-8.al2`\n  - `ghcr.io/shogo82148/lambda-java:build-8.al2-arm64`\n  - `ghcr.io/shogo82148/lambda-java:8.al2-x86_64`\n\n- [.Net Runtimes](https://github.com/shogo82148/docker-lambda/pkgs/container/shogo82148/lambda-dotnet) and [.Net Core Runtimes](https://github.com/shogo82148/docker-lambda/pkgs/container/shogo82148/lambda-dotnetcore)\n\n  - `ghcr.io/shogo82148/lambda-dotnet:6`\n  - `ghcr.io/shogo82148/lambda-dotnet:6-arm64`\n  - `ghcr.io/shogo82148/lambda-dotnet:6-x86_64`\n  - `ghcr.io/shogo82148/lambda-dotnet:build-6`\n  - `ghcr.io/shogo82148/lambda-dotnet:build-6-arm64`\n  - `ghcr.io/shogo82148/lambda-dotnet:build-6-x86_64`\n  - `ghcr.io/shogo82148/lambda-dotnetcore:3.1`\n  - `ghcr.io/shogo82148/lambda-dotnetcore:build-3.1`\n\n- [Provided Runtimes](https://github.com/shogo82148/docker-lambda/pkgs/container/shogo82148/lambda-provided)\n  - `ghcr.io/shogo82148/lambda-provided:al2023`\n  - `ghcr.io/shogo82148/lambda-provided:al2023-arm64`\n  - `ghcr.io/shogo82148/lambda-provided:al2023-x86_64`\n  - `ghcr.io/shogo82148/lambda-provided:build-al2023`\n  - `ghcr.io/shogo82148/lambda-provided:build-al2023-arm64`\n  - `ghcr.io/shogo82148/lambda-provided:build-al2023-x86_64`\n  - `ghcr.io/shogo82148/lambda-provided:al2`\n  - `ghcr.io/shogo82148/lambda-provided:al2-arm64`\n  - `ghcr.io/shogo82148/lambda-provided:al2-x86_64`\n  - `ghcr.io/shogo82148/lambda-provided:build-al2`\n  - `ghcr.io/shogo82148/lambda-provided:build-al2-arm64`\n  - `ghcr.io/shogo82148/lambda-provided:build-al2-x86_64`\n\n## Environment variables\n\n- `AWS_LAMBDA_FUNCTION_HANDLER` or `_HANDLER`\n- `AWS_LAMBDA_EVENT_BODY`\n- `AWS_LAMBDA_FUNCTION_NAME`\n- `AWS_LAMBDA_FUNCTION_VERSION`\n- `AWS_LAMBDA_FUNCTION_INVOKED_ARN`\n- `AWS_LAMBDA_FUNCTION_MEMORY_SIZE`\n- `AWS_LAMBDA_FUNCTION_TIMEOUT`\n- `_X_AMZN_TRACE_ID`\n- `AWS_REGION` or `AWS_DEFAULT_REGION`\n- `AWS_ACCOUNT_ID`\n- `AWS_ACCESS_KEY_ID`\n- `AWS_SECRET_ACCESS_KEY`\n- `AWS_SESSION_TOKEN`\n- `DOCKER_LAMBDA_USE_STDIN`\n- `DOCKER_LAMBDA_STAY_OPEN`\n- `DOCKER_LAMBDA_API_PORT`\n- `DOCKER_LAMBDA_RUNTIME_PORT`\n- `DOCKER_LAMBDA_DEBUG`\n- `DOCKER_LAMBDA_NO_MODIFY_LOGS`\n\n## Build environment\n\nYum packages installed on build images:\n\n- `development` (group, includes `gcc-c++`, `autoconf`, `automake`, `git`, `vim`, etc)\n- `docker` (Docker in Docker!)\n- `clang`\n- `cmake`\n\nThe build image for older Amazon Linux 1 based runtimes also include:\n\n- `python27-devel`\n- `python36-devel`\n- `ImageMagick-devel`\n- `cairo-devel`\n- `libssh2-devel`\n- `libxslt-devel`\n- `libmpc-devel`\n- `readline-devel`\n- `db4-devel`\n- `libffi-devel`\n- `expat-devel`\n- `libicu-devel`\n- `lua-devel`\n- `gdbm-devel`\n- `sqlite-devel`\n- `pcre-devel`\n- `libcurl-devel`\n- `yum-plugin-ovl`\n\n## Questions\n\n- _When should I use this?_\n\n  When you want fast local reproducibility. When you don't want to spin up an\n  Amazon Linux EC2 instance (indeed, network aside, this is closer to the real\n  Lambda environment because there are a number of different files, permissions\n  and libraries on a default Amazon Linux instance). When you don't want to\n  invoke a live Lambda just to test your Lambda package – you can do it locally\n  from your dev machine or run tests on your CI system (assuming it has Docker\n  support!)\n\n- _Wut, how?_\n\n  By [tarring the full filesystem in Lambda, uploading that to S3](./base/dump-nodejs43.js),\n  and then [piping into Docker to create a new image from scratch](./base/create-base.sh) –\n  then [creating mock modules](./nodejs4.3/run/awslambda-mock.js) that will be\n  required/included in place of the actual native modules that communicate with\n  the real Lambda coordinating services. Only the native modules are mocked\n  out – the actual parent JS/PY/Java runner files are left alone, so their behaviors\n  don't need to be replicated (like the overriding of `console.log`, and custom\n  defined properties like `callbackWaitsForEmptyEventLoop`)\n\n- _What's missing from the images?_\n\n  Hard to tell – anything that's not readable – so at least `/root/*` –\n  but probably a little more than that – hopefully nothing important, after all,\n  it's not readable by Lambda, so how could it be!\n\n- _Is it really necessary to replicate exactly to this degree?_\n\n  Not for many scenarios – some compiled Linux binaries work out of the box\n  and an Amazon Linux Docker image can compile some binaries that work on\n  Lambda too, for example – but for testing it's great to be able to reliably\n  verify permissions issues, library linking issues, etc.\n\n- _What's this got to do with LambCI?_\n\n  Technically nothing – it's just been incredibly useful during the building\n  and testing of LambCI.\n\n[lambci/docker-lambda]: https://github.com/lambci/docker-lambda\n[AWS Lambda]: https://aws.amazon.com/lambda/\n[AWS CLI]: https://aws.amazon.com/cli/\n[AWS CLI v2]: https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshogo82148%2Fdocker-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshogo82148%2Fdocker-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshogo82148%2Fdocker-lambda/lists"}