自定义私有 AWS AMI 是否可以用作创建新打包程序映像的基础

发布于 2025-01-13 03:26:08 字数 524 浏览 6 评论 0原文

我是 Packer 的新手,我想知道在配置 Packer JSON 文件的“构建器”部分时是否可以在“source_ami”设置中使用“自定义”非公共 AMI 作为基础映像?我想使用已定制为 Packer 用来构建新 AMI 的“基础”AMI 的 AMI。

...
"builders": [{
   "type": "amazon-ebs",
   "communicator": "ssh",
   "ssh_pty": "true",
   "access_key”: "{{user `aws_access_key`}}",
   "secret_key”: "{{user `aws_secret_key`}}",
   "region": "eu-west-1",
   "source_ami": "ami-my-custom,
   "instance_type": "t2.micro",
   "ssh_username": "ubuntu",
   "ami_name": "new-ami-from-custom {{timestamp}}"
 }],
...

I'm new to using Packer and I was wondering if when configuring the 'builders' section of the Packer JSON file if a 'custom', non-public AMI can be used in the 'source_ami' setting as the base image? I would like to use an AMI that has been customized as the 'base' AMI used by Packer to build a new AMI.

...
"builders": [{
   "type": "amazon-ebs",
   "communicator": "ssh",
   "ssh_pty": "true",
   "access_key”: "{{user `aws_access_key`}}",
   "secret_key”: "{{user `aws_secret_key`}}",
   "region": "eu-west-1",
   "source_ami": "ami-my-custom,
   "instance_type": "t2.micro",
   "ssh_username": "ubuntu",
   "ami_name": "new-ami-from-custom {{timestamp}}"
 }],
...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月寒剑心 2025-01-20 03:26:08

您可以使用自定义虚拟机导入并从中创建一个图像,然后使用它的打包程序,尽管我从未尝试过相同的操作,您可以尝试按照此文档进行相同的操作: https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html

You can use custom vm import and create an image out of it and then use it packer, though I have never tried the same you can try following the same with this doc : https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文