更新时间:2024-01-23 GMT+08:00

使用yaml配置制作镜像并上传到SWR仓库

上传到SWR前,需了解SWR(容器镜像服务)的约束与限制

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
version: 2.0 # 必须是2.0
steps:
  BUILD:
    - build_image:
        name: buildImage
        inputs:
          regions: ["x-x-x", "x-x-xxx"]
          organization: codeci_test
          image_name: demo
          image_tag: ${GIT_COMMIT}
          dockerfile_path: dockerfile/Dockerfile
          # set_meta_data: true

参数名

参数类型

描述

是否必填

默认值

regions

list

选择要上传的区域SWR。默认上传到当前任务所在region的SWR。

organization

string

上传到的SWR组织。

image_name

string

镜像名。

demo

image_tag

string

镜像标签。

v1.1

context_path

string

docker的上下文路径。

.

dockerfile_path

string

dockerfile文件相对context_path的路径。

./Dockerfile

set_meta_data

bool

是否添加构建元数据到镜像。

false