All Products
Search
Document Center

CloudOps Orchestration Service:Build and push an image to ACR

Last Updated:Jun 03, 2026

Build a Docker image on an existing or temporary ECS instance and push it to ACR Personal Edition (free) or Enterprise Edition. Temporary instances are auto-released after build.

Prerequisites

How it works

image
  1. When you specify a code source (OSS or Git), OOS generates a temporary URL to pull the code.

  2. After building the image, OOS connects to ACR and pushes it to the specified repository.

Example

Prepare the code source

This example uses a sample Spring Boot project. The code is available in Gitee and GitHub repositories. Before you start, fork the project to your own repository.

Create a template

  1. Log on to the CloudOps Orchestration Service console.

  2. In the left-side navigation pane, choose automated task > custom task template, and then click Create Template.

  3. In the Building and Deployment section, select Build an image and push it to ACR, and then click Next.

  4. On the Process Configuration tab, specify the template parameters, and then click Create Template.

    1. Specify a code source to generate a temporary authorization link for pulling the code.

      This example uses Gitee as the code source. Enter the Owner, Organization, repository, and branch for your repository.

      Note
      • If you have not authorized Alibaba Cloud to read your repositories from GitHub or Gitee, click Go to Authorization to grant access.

      • If you have already forked the sample code, your repositories are automatically listed in the repository drop-down list. Select the forked repository.

      2024-12-16_11-42-41.png

    2. Build a Docker image and push it to ACR.

      1. Specify the code source, select the ECS instance for the build, and then configure the build script as needed.

        Docker image build configuration

        • Code Source and Code Source URL: Set Code Source to git. Code Source URL defaults to authorizedUrl from the previous task.

        • Select the ECS instance for the build: Choose Build on an existing ECS instance or Start a temporary ECS instance for the build.

          Note

          If you select Start a temporary ECS instance for the build, the instance is billed on a pay-as-you-go basis. OOS automatically checks if Docker is installed on the ECS instance. If not, OOS installs Docker Community Edition for you.

        • Build Configurations: Optional pre-build commands. Not needed if all steps are in the Dockerfile.

      2. Configure the Docker build and the push to an ACR repository.

        OOS runs docker build. Specify the Dockerfile path and context path.

        ACR.png

        • Dockerfile Path: Path to the Dockerfile, relative to the code repository root. For example, enter Dockerfile if it is in the root directory.

          image

        • Context Path: Context path for docker build, relative to the code repository root. Defaults to the Dockerfile directory if empty.

        • Container Registry Type: Select the ACR edition to which you want to push the image.

          Container registry type

          Description

          Related links

          Personal Edition

          Select your username, password, and target repository.

          Create a Personal Edition instance

          Enterprise Edition

          Select the Container Registry instance ID, namespace, and repository.

          Create an Enterprise Edition instance

          Specify an image tag. The default uses the current date and execution ID. To push over the internal network, Configure access control for a VPC.

    3. Click Create Template.

Execute the template

  1. Log on to the CloudOps Orchestration Service console.

  2. In the left-side navigation pane, choose automated task > custom task template.

  3. On the custom task template page, find the template that you created and click Create an execution in the Actions column.

  4. In the Basic Information step, configure the parameters and click Next: Set Parameters.

  5. In the Parameter Settings step, if no changes are needed, click Next: Confirm.

  6. Click Create.

    On the task execution management page, a status of Successful indicates that the execution is complete.

    执行模板结果-zh.png

  7. In the Container Registry (ACR) console, verify that the image appears in the target repository.

    The image is now ready for deployment.

    Image versions

Next steps

To rebuild from updated code, push changes to the Git repository and rerun the execution. OOS pulls the latest code, rebuilds, and pushes the image. Update the template before rerunning if needed.