Description of changes:
Added ability to use DockerBuildArgs in Amazon.Lambda.Tools serverless template. This change required implementation for both JSON and YAML template parsers.
Amazon Lambda Tools for .NET Core applications (5.4.1)
Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet
Enter CloudFormation Stack Name: (CloudFormation stack name for an AWS Serverless application)
teststack
Enter S3 Bucket: (S3 bucket to upload the build output)
mappingNode.Children
Warning: Unable to determine region for bucket mappingNode.Children, assuming bucket is in correct region: The specified bucket does not exist
Processing CloudFormation resource UseDockerMetadataFunction
Initiate packaging of ./UseDockerMetadata for resource UseDockerMetadataFunction
Building Docker image for D:\source\repros\ServerlessTemplateExamples\./UseDockerMetadata
Inspecting Dockerfile to figure how to build project and docker image
Executing docker build
... invoking 'docker build', working folder 'D:\source\repros\ServerlessTemplateExamples\./UseDockerMetadata, docker file D:\source\repros\ServerlessTemplateExamples\./UseDockerMetadata\Dockerfile.custom, image name aws-extensions-tests:usedockermetadata'
... docker build -f "D:\source\repros\ServerlessTemplateExamples\./UseDockerMetadata\Dockerfile.custom" -t aws-extensions-tests:usedockermetadata --build-arg PROJECT_PATH=/src/path-to/project --build-arg PROJECT_FILE=project.csproj .
... docker build: Sending build context to Docker daemon 228.9kB
... docker build: Step 1/3 : FROM public.ecr.aws/lambda/dotnet:5.0
... docker build: 5.0: Pulling from lambda/dotnet
... docker build: image operating system "linux" cannot be used on this platform
Error executing "docker build"
NOTE: The deployment fails due to incompatibility of Linux image while testing on Windows based environment, which is fine. The correct --build-arg(s) are passed to docker build call.
We need to add version bump commits in dev branch before actual release of queued changes.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available: #201
Description of changes: Added ability to use
DockerBuildArgs
inAmazon.Lambda.Tools
serverless template. This change required implementation for both JSON and YAML template parsers.Testing: Tested (in debug mode) using the following templates for sample https://github.com/aws/aws-extensions-for-dotnet-cli/tree/master/testapps/ImageBasedProjects/ServerlessTemplateExamples: JSON template:
YAML template:
Output:
NOTE: The deployment fails due to incompatibility of Linux image while testing on Windows based environment, which is fine. The correct
--build-arg
(s) are passed todocker build
call.We need to add version bump commits in
dev
branch before actual release of queued changes.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.