All Products
Search
Document Center

What Can I Do if Images Fail to be Built in Container Registry?

Last Updated: May 19, 2022

Overview

Alibaba Cloud Container Registry allows you to build images from a code source. Container Registry automates the building and delivery of images from source code repositories to Container Registry repositories based on Dockerfiles. If an error occurs, images may fail to be built. This document describes the issues that may occur in the process of building images, causes, and solutions.

Details

Problem type

Problem description

Solution

Failure to bind a source code repository

Note: To use Image Builder in Container Registry, you must bind an image repository to a source code repository.

When you select a code source, an error message appears to remind you that the account of the source code repository has no permission to access GitLab.

Check whether the code source is bound in Container Registry.

You select a code source, but the source code repository that you create fails to be found due to one of the following causes:

  • No source code repositories are displayed.
  • The source code repositories that belong to a project group are not supported.
  • Many GitLab source code repositories are displayed in the drop-down list, but you cannot find the one that you create.

Select an appropriate solution based on your needs:

  • The issue may be caused by the unstable network connection across regions. You can enter a namespace and a repository name in the fields.
  • The URL of the Git repository that you create is invalid. Make sure that the URL of a Git repository is limited to a two-level directory, such as namespace/repository.git.
  • All public source code repositories are displayed in the drop-down list. You can enter a namespace and a repository name in the fields.

You create an image repository, but cannot find the Build page.

Container Registry performs the following steps to create an image repository and bind it to a source code repository:

1.    Create an image repository.

2.    Send a request to your source code repository by using the access token that you specify, and set a webhook in the repository.

3.    Bind the image repository that is created in Step 1 to your source code repository.

Then, you can perform the following steps to go to the Build page:

  • Go to the details page of the created image repository. In the left-side navigation pane, click Build. The Build page appears.
  • If you cannot find the Build page, perform the following steps:
    1. Refresh the page in the Container Registry console and check whether an image repository is created.
    2. Make sure that the access token you specify in Container Registry has the permission to set a webhook.
    3. Make sure that the namespace and the repository name of the source code repository are the same as those in the URL of the Git repository. 

Failure to create an image build rule

The number of image build rules has reached the upper limit.

If you need to create more rules, submit a ticket.

Failure to automatically build images

When Container Registry is triggered to match image build rules and build an image based on a webhook request that is sent by your source code platform, the image may fail to be built.

  • The webhook is accidentally deleted from your source code repository. You need to set a webhook again.
  • The namespace and the repository name of your source code repository are not the same as those in the URL of the Git repository. Maybe you change the username and repository name. You must roll back the changed username and repository name.

Slow image building

The building of images is slowed down by code pulling, image pulling, and resource download due to the unstable network connection across regions.

Use the following features of Container Registry to accelerate image building:

  • If you use an instance of Container Registry Enterprise Edition, perform the following steps as needed:
    1. You can enable the Intelligently Build Overseas Sources feature.

    2. If the speed of image pulling from a data center in mainland China is affected by the Intelligently Build Overseas Sources feature, you can directly pull images from the data center in mainland China.

    3. Combine the preceding two features to accelerate image building from various sources.

  • If you use an instance of Container Registry Default Instance Edition, perform the following steps as needed:
    1. You can enable the Build With Servers Deployed Outside Mainland China feature.
    2. You can disable the Build Without Cache feature.

Failure to pull source code

A source code repository does not exist, or you have no permission to access the source code repository.

If the username of an Alibaba Cloud Code account is changed, source code cannot be pulled from the remote source code repository. Perform the following steps:

  1. Roll back the changed username.
  2. Submit a ticket to bind the Alibaba Cloud Code account again.

Pulling source code times out.

The issue is caused by the unstable network connection across regions. For more information about how to use the Intelligently Build Overseas Sources feature to accelerate code pulling, see Slow image building.

Failure to pull images

Images fail to be pulled from a data center outside China.

Container Registry uses images from Docker Hub. However, if you use an image from a cloud service provider outside China, the speed of image pulling may be slow due to the unstable network connection across regions. Use the following methods:

  • We recommend that you upload the image from a cloud service provider outside China to Container Registry. Then, you can directly use the image in Container Registry.
  • You can enable the Intelligently Build Overseas Sources feature.

Images fail to be pulled from an instance of Container Registry Default Instance Edition by using the virtual private cloud (VPC) endpoint of the instance.

If you want to build an image from the instance of Container Registry Default Instance Edition, use the public endpoint of the instance.

Images fail to be pulled from an instance of Container Registry Enterprise Edition by using the public endpoint of the instance.

If you want to build an image from the instance of Container Registry Enterprise Edition, use the VPC endpoint of the instance.

Submit a ticket for other situations.

Failure to push images

Images may fail to be pushed due to network conditions.

  • Container Registry Default Instance Edition: Assume that you enable the Build With Servers Deployed Outside Mainland China feature. An image from an instance of Container Registry Default Instance Edition may fail to be pushed to a region in mainland China due to the unstable network connection across regions. Try again or disable the Build With Servers Deployed Outside Mainland China feature.
  • Container Registry Enterprise Edition: If an image from an instance of Container Registry Enterprise Edition fails to be pushed by using the VPC endpoint of the instance, submit a ticket.

Long Pending state for image build tasks

The Image Builder feature of both Container Registry Default Instance Edition and Container Registry Enterprise Edition imposes a limit on the number of concurrent tasks for a single user.

  1. If the issue is caused by excessive image build tasks, use the following methods:
    • If you use an instance of Container Registry Default Instance Edition, upgrade your instance to Container Registry Enterprise Edition.
    • If you use an instance of Container Registry Enterprise Edition, apply for an increased quota of image build tasks.
  2.  If the number of concurrent tasks does not exceed the upper limit, but a task is in the Pending state for a long time, submit a ticket.

Failure in the process of building images

Although the cause of errors is complex, the process of building images may fail in two scenarios.

  • Pulling resources times out. For more information about how to accelerate image pulling, see Slow image building.
  • The command to build images fails to be run. Confirm that an image build task can be run on your on-premises machine, and then submit a ticket for analyzing the possible causes.

Applicable scope

  • Container Registry