Skip to content

Commit 2055256

Browse files
fix: Skips the runtime test when building in docker (#362)
Co-authored-by: Allan Benson <[email protected]>
1 parent adf6ea7 commit 2055256

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,10 @@ Using this module you can install dependencies from private hosts. To do this, y
470470

471471
docker_with_ssh_agent = true
472472

473+
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.
474+
475+
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.
476+
473477
## <a name="package"></a> Deployment package - Create or use existing
474478

475479
By default, this module creates deployment package and uses it to create or update Lambda Function or Lambda Layer.

package.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ def pip_requirements_step(path, prefix=None, required=False, tmp_dir=None):
657657
raise RuntimeError(
658658
'File not found: {}'.format(requirements))
659659
else:
660-
if not shutil.which(runtime):
660+
if not query.docker and not shutil.which(runtime):
661661
raise RuntimeError(
662662
"Python interpreter version equal "
663663
"to defined lambda runtime ({}) should be "
@@ -675,7 +675,7 @@ def npm_requirements_step(path, prefix=None, required=False, tmp_dir=None):
675675
raise RuntimeError(
676676
'File not found: {}'.format(requirements))
677677
else:
678-
if not shutil.which(runtime):
678+
if not query.docker and not shutil.which(runtime):
679679
raise RuntimeError(
680680
"Nodejs interpreter version equal "
681681
"to defined lambda runtime ({}) should be "

0 commit comments

Comments
 (0)