Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion python/rpdk/python/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Python36LanguagePlugin(LanguagePlugin):
RESOURCE_ENTRY_POINT = "{}.handlers.resource"
TEST_ENTRY_POINT = "{}.handlers.test_entrypoint"
CODE_URI = "build/"
DOCKER_TAG = 3.6

def __init__(self):
self.env = self._setup_jinja_env(
Expand Down Expand Up @@ -274,7 +275,7 @@ def _docker_build(cls, external_path):
LOG.debug("command is '%s'", command)

volumes = {str(external_path): {"bind": str(internal_path), "mode": "rw"}}
image = f"lambci/lambda:build-{cls.RUNTIME}"
image = f"public.ecr.aws/lambda/python:{cls.DOCKER_TAG}"
LOG.warning(
"Starting Docker build. This may take several minutes if the "
"image '%s' needs to be pulled first.",
Expand All @@ -288,6 +289,7 @@ def _docker_build(cls, external_path):
auto_remove=True,
volumes=volumes,
stream=True,
entrypoint="",
user=f"{os.geteuid()}:{os.getgid()}",
)
except RequestsConnectionError as e:
Expand Down Expand Up @@ -325,3 +327,4 @@ def _pip_build(cls, base_path):
class Python37LanguagePlugin(Python36LanguagePlugin):
NAME = "python37"
RUNTIME = "python3.7"
DOCKER_TAG = 3.7
2 changes: 2 additions & 0 deletions tests/plugin/codegen_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ def test__docker_build_good_path(plugin, tmp_path):
auto_remove=True,
volumes={str(tmp_path): {"bind": "/project", "mode": "rw"}},
stream=True,
entrypoint="",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These images come with an entrypoint. This just removes that entrypoint

user=ANY,
)

Expand Down Expand Up @@ -479,5 +480,6 @@ def test__docker_build_bad_path(plugin, tmp_path, exception):
auto_remove=True,
volumes={str(tmp_path): {"bind": "/project", "mode": "rw"}},
stream=True,
entrypoint="",
user=ANY,
)