You need to enable JavaScript to run this app.
文档中心
持续交付

持续交付

复制全文
下载 pdf
步骤列表
镜像构建
复制全文
下载 pdf
镜像构建
镜像步骤用于构建容器镜像并将其推送到指定的镜像仓库。​
镜像构建推送至平台镜像仓库(CR)​
使用 BuildKit 高效构建 Docker 镜像,并将其自动推送至平台提供的容器镜像服务(CR)。​
  • 组件:buildkit-cr@4.0.0​
  • 参数:​
  • ​
    参数​
    数据类型​
    是否必填​
    默认值​
    说明​
    region​
    string​
    是​
    -​
    镜像仓库所在的地域。​
    registryInstance​
    string​
    是​
    -​
    镜像仓库实例。​
    namespace​
    string​
    是​
    -​
    镜像仓库的命名空间。​
    repo​
    string​
    是​
    -​
    仓库名称。​
    tag​
    string​
    是​
    -​
    镜像标签。​
    dockerfiles​
    object​
    是​
    -​
    Dockerfile 的来源。通过 default.path 指定文件路径,或通过 default.content 指定内联内容。​
    contextPath​
    string​
    是​
    .​
    Docker 构建上下文的相对路径。​
    compression​
    enum​
    否​
    gzip​
    镜像压缩算法,可选 gzip、zstd。​
    useCache​
    boolean​
    否​
    -​
    是否使用缓存加速镜像构建。​
    • true:使用缓存。​
    • false:默认值,不使用缓存。​
    disableSSLVerify​
    boolean​
    否​
    -​
    是否禁用 SSL 证书验证。​
    • true:禁用。​
    • false:默认值,不禁用。​
    buildParams​
    string​
    否​
    -​
    支持指定 --build-arg、--target 等 docker build 相关参数。​
    ​
  • 示例​
  • ​
    tasks:​
    - task: build-image-and-push-to-registry​
    displayName: Build and Push to CR​
    steps:​
    - step: buildkit-cr​
    displayName: Build and Push to CR​
    component: buildkit-cr@4.0.0​
    inputs:​
    region: cn-beijing​
    registryInstance: my-registry-instance​
    namespace: my-namespace​
    repo: my-repo​
    tag: v1.0.0​
    contextPath: .​
    dockerfiles:​
    default:​
    path: ./Dockerfile​
    ​
镜像构建推送至自定义仓库​
构建 Docker 镜像并将其推送到用户自定义的、非平台管理的镜像仓库(如 Docker Hub、Harbor 等)。​
  • 组件:buildkit-custom@3.0.0​
  • 参数:​
  • ​
    参数​
    数据类型​
    是否必填​
    默认值​
    说明​
    customImageAddress.protocol​
    enum​
    是​
    https​
    仓库地址协议,可选 http、https。​
    customImageAddress.address​
    string​
    是​
    -​
    完整的镜像地址,格式为 host/repo:tag。​
    loginCredential​
    list​
    否​
    -​
    访问自定义仓库的凭据,使用服务连接。​
    dockerfiles​
    object​
    是​
    -​
    Dockerfile 来源,通过 default.path 或 default.content 指定。​
    contextPath​
    string​
    是​
    -​
    构建上下文路径。​
    compression​
    enum​
    否​
    gzip​
    压缩算法,可选 gzip、zstd。​
    useCache​
    boolean​
    否​
    -​
    是否使用缓存加速镜像构建。​
    • true:使用缓存。​
    • false:默认值,不使用缓存。​
    disableSSLVerify​
    boolean​
    否​
    -​
    是否禁用 SSL 证书验证。​
    • true:禁用。​
    • false:默认值,不禁用。​
    buildParams​
    string​
    否​
    -​
    支持指定 --build-arg、--target 等 docker build 相关参数。​
    ​
  • 示例:​
  • ​
    tasks:​
    - task: build-image-and-push-to-custom-server​
    displayName: Build and Push to Custom Registry​
    steps:​
    - step: buildkit-custom​
    displayName: Build and Push to Custom Registry​
    component: buildkit-custom@3.0.0​
    inputs:​
    customImageAddress:​
    protocol: https​
    address: registry.example.com/my-org/my-app:v1.0.0​
    contextPath: .​
    dockerfiles:​
    default:​
    path: ./Dockerfile​
    ​
​
最近更新时间:2026.05.11 11:33:36
这个页面对您有帮助吗?
有用
有用
无用
无用