简体   繁体   English

SAM 应用程序中的 PackageType: Image 和 build --use-container 之间有什么区别?

[英]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 示例)以及ImageUriMetadata而且它也不希望我使用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 ,但我的PackageTypezip ,并且在我构建它时(使用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.

相关问题 执行命令时出错:sam build --use-container --template ${SAM_TEMPLATE}。 原因:退出状态1 - Error while executing command: sam build --use-container --template ${SAM_TEMPLATE}. Reason: exit status 1 使用SAM时AWS sam build和sam package有什么区别? - What's the difference between AWS sam build and sam package when using SAM? SAM模板和Cloudformation模板的区别 - Difference between SAM template and Cloudformation template 在 App Engine 和 Compute Engine 中启动 docker 容器有什么区别? - What's the difference between launching a docker container in App Engine vs Compute Engine? 使用“Container.GetItemLinqQueryable”和“Container.GetItemQueryIterator”有什么区别? - What is the difference between using "Container.GetItemLinqQueryable" and "Container.GetItemQueryIterator"? Cloud Build 和 Cloud Deploy 有什么区别? - What is the difference between Cloud Build and Cloud Deploy? 使用 sam init 部署 AWS Lambda“Hello World”,sam build sam deploy defaults 失败,无法为 sam-app 创建变更集 - Deploying AWS Lambda "Hello World" using sam init, sam build sam deploy defaults fails with Failed to create changeset for sam-app 有没有一种方法可以使用 AWS SAM 增量构建容器镜像? - Is there a way to incrementally build container images with AWS SAM? Beanstalk 中的 commands 和 container_commands 配置键有什么区别? - What is the difference between commands and container_commands configuration keys in Beanstalk? getIdToken 和 getAppCheckToken 有什么区别? - What is difference between the getIdToken and getAppCheckToken?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM