Help Center> CodeArts Build> User Guide> Configuring Build Actions> Code-based Build> Configuring a Task> Using YAML to Create an Image and Upload It to SWR
Updated on 2023-12-06 GMT+08:00

Using YAML to Create an Image and Upload It to SWR

Before uploading an image to SWR, learn about the Notes and Constraints of SWR.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
version: 2.0 # The value must be 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

Parameter

Type

Description

Mandatory

Default Value

regions

list

Select the regional SWR to be uploaded. By default, the file is uploaded to SWR in the region where the current task is located.

No

None

organization

string

Upload to the SWR organization.

Yes

None

image_name

string

Image name.

No

demo

image_tag

string

Image tag.

No

v1.1

context_path

string

Docker context path.

No

.

dockerfile_path

string

Path of the dockerfile relative to context_path.

No

./Dockerfile

set_meta_data

bool

Whether to add build metadata to the image.

No

false