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
7 changes: 5 additions & 2 deletions samcli/local/docker/lambda_build_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LambdaBuildContainer(Container):
and if the build was successful, copies back artifacts to the host filesystem
"""

_IMAGE_REPO_NAME = "lambci/lambda"
_LAMBCI_IMAGE_REPO_NAME = "lambci/lambda"
_BUILDERS_EXECUTABLE = "lambda-builders"

def __init__(self, # pylint: disable=too-many-locals
Expand Down Expand Up @@ -229,4 +229,7 @@ def _convert_to_container_dirs(host_paths_to_convert, host_to_container_path_map

@staticmethod
def _get_image(runtime):
return "{}:build-{}".format(LambdaBuildContainer._IMAGE_REPO_NAME, runtime)
runtime_to_images = {"nodejs10.x": "amazon/lambda-build-node10.x"}

return runtime_to_images.get(runtime,
"{}:build-{}".format(LambdaBuildContainer._LAMBCI_IMAGE_REPO_NAME, runtime))
11 changes: 8 additions & 3 deletions tests/unit/local/docker/test_lambda_build_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
except ImportError:
import pathlib2 as pathlib


from unittest import TestCase
from mock import patch

from parameterized import parameterized

from samcli.local.docker.lambda_build_container import LambdaBuildContainer


Expand Down Expand Up @@ -157,8 +158,12 @@ def test_must_override_manifest_if_equal_to_source(self):

class TestLambdaBuildContainer_get_image(TestCase):

def test_must_get_image_name(self):
self.assertEquals("lambci/lambda:build-myruntime", LambdaBuildContainer._get_image("myruntime"))
@parameterized.expand([
("myruntime", "lambci/lambda:build-myruntime"),
("nodejs10.x", "amazon/lambda-build-node10.x")
])
def test_must_get_image_name(self, runtime, expected_image_name):
self.assertEquals(expected_image_name, LambdaBuildContainer._get_image(runtime))


class TestLambdaBuildContainer_get_entrypoint(TestCase):
Expand Down