You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Docker中选择并下载Azure Bicep指定版本?

问题与解决方案

固定Bicep版本的下载方式

我之前在Docker镜像中,按照Azure官方文档的指引使用以下命令安装Bicep:

# Install Bicep
RUN curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64
RUN chmod +x ./bicep
RUN mv ./bicep /usr/local/bin/bicep

后来想要将Bicep版本固定为v0.23.1,尝试修改curl命令指定版本时一开始没成功,后续排查发现问题并非出在curl命令本身,而是PSRule的配置有误。

正确的指定版本下载命令

只需将原命令中的latest替换为目标版本号即可,具体命令如下:

# Install Bicep v0.23.1
RUN curl -Lo bicep https://github.com/Azure/bicep/releases/download/v0.23.1/bicep-linux-x64
RUN chmod +x ./bicep
RUN mv ./bicep /usr/local/bin/bicep

正确的PSRule配置

以下是验证有效的ps-rule.yml配置内容:

requires:
  # Require PSRule for Azure v1.30.1
  PSRule: '2.9.0'
  PSRule.Rules.Azure: '1.30.1'

内容的提问来源于stack exchange,提问作者DataBach

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 11:00:56