【问题标题】:listing the gcp images in the marketplace from the gcloud commandline从 gcloud 命令行列出市场中的 gcp 映像
【发布时间】:2018-07-31 09:14:55
【问题描述】:

如何从 gcloud 命令行列出市场中的 gcp 图像? “gcloud 计算图像列表”仅显示项目中的标准图像,可能会跳过市场列表。

【问题讨论】:

    标签: google-cloud-platform


    【解决方案1】:

    默认情况下,cli 仅显示标准图像。

        --standard-images
          Show images from well-known image projects. The well known image
          projects are: centos-cloud, coreos-cloud, debian-cloud, cos-cloud,
          rhel-cloud, rhel-sap-cloud, suse-cloud, suse-sap-cloud,
          ubuntu-os-cloud, windows-cloud, windows-sql-cloud. Enabled by default,
          use --no-standard-images to disable.
    

    要列出来自特定项目的图像,您要指定--project 标志。 示例:

    # gcloud compute images list --project=click-to-deploy-images --filter="name ~ 'nginx.*'"
    

    【讨论】:

    • 嗨,斯坦,谢谢。这非常有用。但是,我无法搜索市场图像。我想我可能需要找出市场产品的项目名称?
    • @aanandan,市场图像只是跨多个项目存储的常规图像。所以是的,您需要先找出项目名称,然后执行搜索。据我所知,无法从所有公共项目(类似于市场网页的工作方式)中使用 gcloud cli 进行搜索。我已经仔细检查了两个 API:v1 和 beta。当指定--standard-images 标志时,cli 只执行逐个项目的搜索,与指定--project 时的行为完全相同。这真的很烦人,但目前看来网页是查找与图像相关的项目的唯一方法。
    • 附注拥有# gcloud marketplace ... 之类的东西会很酷
    • 是的,完全同意你的看法。感谢您跟进 cmets。干杯。
    猜你喜欢
    • 2019-04-16
    • 1970-01-01
    • 2016-02-01
    • 2021-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-06
    • 2019-05-11
    相关资源
    最近更新 更多