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 you set Dockerfile in a function's metadata, but notDockerContext, sam build seems to just work, except then sam local invoke complains Error: ImageUri not provided for Function: YourFunctionName of PackageType: Image which is very confusing. Note also sam validate doesn't complain abou this.
Steps to reproduce:
Create a correct docker image SAM template, then remove just the DockerContext metadata param.
Observed result:
sam local invoke fails with a confusing error
Expected result:
sam validate fails, or maybe sam build?
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Thanks @palfrey for reporting. I was able to confirm the behaviour you're describing. The main issue to me here seems not properly handling the missing DockerContext during sam build since it doesn't end up building any images. I will mark it as a bug for the team to prioritize.
Description:
If you set
Dockerfile
in a function's metadata, but notDockerContext
,sam build
seems to just work, except thensam local invoke
complainsError: ImageUri not provided for Function: YourFunctionName of PackageType: Image
which is very confusing. Note alsosam validate
doesn't complain abou this.Steps to reproduce:
Create a correct docker image SAM template, then remove just the
DockerContext
metadata param.Observed result:
sam local invoke
fails with a confusing errorExpected result:
sam validate
fails, or maybesam build
?Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.116.0The text was updated successfully, but these errors were encountered: