[英]What is the difference between PackageType: Image and build --use-container in a SAM App?
PackageType: image
seems to require a Dockerfile (looking at the hello-world example) along with ImageUri
and Metadata
And it also doesn't want me to use Runtime, Handler, Layers
(not even using layers) PackageType: image
似乎需要 Dockerfile(查看 hello-world 示例)以及ImageUri
和Metadata
而且它也不希望我使用Runtime, Handler, Layers
(甚至不使用图层)
whereas build --use-container
does not seem to need anything.而
build --use-container
似乎不需要任何东西。 Does it figure it all out from the Runtime: nodejs14.x-v1
它是否从
Runtime: nodejs14.x-v1
In the documentation I don't see anything在文档中我什么也没看到
When I google there are tons of docs and resources but none related当我用谷歌搜索时,有大量的文档和资源,但没有相关的
I would really like to know because I'm at building a pipeline stage now.我真的很想知道,因为我现在正处于构建管道阶段。 I got it to work great with a single stage and would now like to use the multi-stage multi-account and from what I read, it is recommended to use Images.
我让它在单阶段工作得很好,现在想使用多阶段多帐户,根据我的阅读,建议使用图像。
I noticed that the current pipeline does have --use-container
, but my PackageType
is zip
, and at some point when I built it (using sam pipeline --bootstrap
) it asked me if any of my functions use images.我注意到当前管道确实有
--use-container
,但我的PackageType
是zip
,并且在我构建它时(使用sam pipeline --bootstrap
)在某个时候它询问我是否有任何函数使用图像。 I would like for my multi stage/account one to answer Y
我想让我的多阶段/账户回答
Y
It may not be related, but that is also how I plan on using environment variables for each account, since the databases used to fetch data are different.它可能不相关,但这也是我计划为每个帐户使用环境变量的方式,因为用于获取数据的数据库不同。 So I think I'll have to go and add
--container-env-var-file
in the gitlab-ci.yml script, or maybe in the samconfig.toml [dev.build.parameters]
and under [prod.build.parameters] for its
env-prod.json` file所以我想我必须输入 go 并在 gitlab-ci.yml 脚本中添加
--container-env-var-file
,或者在samconfig.toml [dev.build.parameters]
和 [prod.build. parameters] for its
env-prod.json` 文件
SAM application package types can be either Zip or Images (container images). SAM 应用程序 package 类型可以是 Zip 或 Images(容器镜像)。 The details of their differences are described in their docs here: https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html
他们的差异细节在他们的文档中描述: https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html
I came across that page when I was reading the AWS docs for auto-creating a new SAM app here: https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/serverless-apps.html#serverless-apps-create我在此处阅读有关自动创建新 SAM 应用程序的 AWS 文档时看到了该页面: https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/serverless-apps.html#无服务器应用程序创建
(when you need to: "Choose the runtime for your AWS SAM application") (当您需要:“为您的 AWS SAM 应用程序选择运行时”)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.