【问题标题】:How to create a new packer image from an existing private packer image in Azure如何从 Azure 中的现有私有打包程序映像创建新打包程序映像
【发布时间】:2018-08-23 09:01:08
【问题描述】:

我正在使用这两个链接创建一个打包器图像: https://www.packer.io/docs/builders/azure.html https://docs.microsoft.com/en-us/azure/virtual-machines/linux/build-image-with-packer

我想使用“私人图像”而不是市场图像来构建:

"managed_image_resource_group_name": "myResourceGroup",
"managed_image_name": "myPackerImage",

"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "16.04-LTS",

如何在“image_publisher”、“image_offer”、“image_sku”等中引用我自己的图片?

"os_type": "Linux",
"image_publisher": "myPrivateRepo",
"image_offer": "UbuntuWeb",
"image_sku": "16-1.0",

提前致谢

【问题讨论】:

    标签: azure packer


    【解决方案1】:

    我自己从未尝试过,但它似乎像 this 一样工作。

    代替

    "image_publisher": "Canonical",
    "image_offer": "UbuntuServer",
    "image_sku": "16.04.0-LTS",
    

    "image_url": "https://my-storage-account.blob.core.windows.net/path/to/your/custom/image.vhd",
    

    【讨论】:

    • 有没有办法找到这个 blob?我试图找到这个最初由以下人员创建的 vhd:* Portal * az image list
    • 如果您有任何存储帐户,请查看 Azure 门户。在它们里面打开“blob”,你应该在那里找到你的 .vhd 文件。
    • 其实只对非托管镜像(VHD)有效,az image list返回托管镜像。
    • az image list 将显示除.vhd 的 image_url 之外的所有图像我如何使用现有的管理图像
    • 如果管理图像输出为 OSType:Windows ManagedImageResourceGroupName:myResourceGroup ManagedImageName:packerimagewin2019up ManagedImageId:/subscriptions/XXXXXXXXX/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/packerimagewin2019up ManagedImageLocation:eastus跨度>
    【解决方案2】:

    我使用了custom_managed_image_namecustom_managed_image_resource_group_name 属性来让它工作。

    【讨论】:

      猜你喜欢
      • 2019-10-05
      • 2019-07-28
      • 1970-01-01
      • 2021-04-09
      • 1970-01-01
      • 2017-05-27
      • 2013-05-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多