You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your Lambda Function or Layer uses some dependencies you can build them in Docker and have them included into deployment package. Here is how you can do it:
runtime = "python3.8" # Setting runtime is required when building package in Docker and Lambda Layer resource.
471
+
docker_file = "src/python-app1/docker/Dockerfile"
472
+
docker_build_root = "src/python-app1/docker"
473
+
docker_image = "public.ecr.aws/sam/build-python"
474
+
runtime = "python3.12" # Setting runtime is required when building package in Docker and Lambda Layer resource.
475
475
476
476
Using this module you can install dependencies from private hosts. To do this, you need for forward SSH agent:
477
477
478
478
docker_with_ssh_agent = true
479
479
480
-
Note that by default, the `docker_image` used comes from the registry `public.ecr.aws/sam/`, and will be based on the `runtime` that you specify. In other words, if you specify a runtime of `python3.8` and do not specify `docker_image`, then the `docker_image` will resolve to `public.ecr.aws/sam/build-python3.8`. This ensures that by default the `runtime` is available in the docker container.
480
+
Note that by default, the `docker_image` used comes from the registry `public.ecr.aws/sam/`, and will be based on the `runtime` that you specify. In other words, if you specify a runtime of `python3.12` and do not specify `docker_image`, then the `docker_image` will resolve to `public.ecr.aws/sam/build-python3.12`. This ensures that by default the `runtime` is available in the docker container.
481
481
482
482
If you override `docker_image`, be sure to keep the image in sync with your `runtime`. During the plan phase, when using docker, there is no check that the `runtime` is available to build the package. That means that if you use an image that does not have the runtime, the plan will still succeed, but then the apply will fail.
483
483
@@ -524,7 +524,7 @@ This can be implemented in two steps: download file locally using CURL, and pass
0 commit comments