Container Registry allows you to build images from a code source. Container Registry automates the building of images and the 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 topic describes the issues that may occur in the process of building images, causes, and solutions.
Failure to bind a source code repository
Problem description 1
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.
Solutions: Check whether the code source is bound in Container Registry.
Problem description 2
- 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.
- 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.
Problem description 3
You create an image repository, but cannot find the Build page.
- Creates an image repository.
- Sends a request to your source code repository by using the access token that you specify, and set a webhook in the repository.
- Binds the image repository that is created in Step 1 to your source code repository.
- 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:
- Refresh the page in the Container Registry console and check whether an image repository is created.
- Make sure that the access token you specify in Container Registry has the permissions to set a webhook.
- 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 building rule
Problem description
The number of image building rules has reached the upper limit.
Solutions: If you need to create more rules, increase the quota.
Failure to automatically build images
Problem description
When Container Registry is triggered to match image building 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
Problem description
The building of images is slowed down by code pulling, image pulling, and resource download due to the unstable network connection across regions.
Solutions
- If you use a Container Registry Enterprise Edition instance, perform the following steps as needed:
- You can enable the Intelligently Build Overseas Sources feature.
- If the speed of image pulling from a data center in the Chinese mainland is affected by the Intelligently Build Overseas Sources feature, you can directly pull images from the data center in the Chinese mainland.
- Combine the preceding two features to accelerate image building from various sources.
- If you use a Container Registry Personal Edition instance, perform the following steps as needed:
- You can enable the Build With Servers Deployed Outside Chinese Mainland feature.
- You can disable the Build Without Cache feature.
Failure to pull source code
Problem description 1
A source code repository does not exist, or you have no permission to access the source code repository.
Solutions
- Roll back the changed username.
- Rebind the Alibaba Cloud Code account.
Problem description 2
Pulling source code times out.
Solutions
The issue is caused by the unstable network connection across regions. You can use the Intelligently Build Overseas Sources feature to accelerate code pulling. For more information, see Slow image building.
Failure to pull images
Problem description 1
Images fail to be pulled from a data center outside China.
Solutions
- 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.
Problem description 2
Images fail to be pulled from a Container Registry Personal Edition instance by using the virtual private cloud (VPC) endpoint of the instance.
Solutions
If you want to build an image from the Container Registry Personal Edition instance, use the public endpoint of the instance.
Problem description 3
Images fail to be pulled from a Container Registry Enterprise Edition instance by using the public endpoint of the instance.
Solutions
If you want to build an image from the Container Registry Enterprise Edition instance, use the VPC endpoint of the instance.
Failure to push images
Problem description
Images may fail to be pushed due to network conditions.
Solutions
Assume that you enable the Build With Servers Deployed Outside Chinese Mainland feature. An image that is created on a Container Registry Personal Edition instance may fail to be pushed to a region in the Chinese mainland due to the unstable network connection across regions. Try again or disable the Build With Servers Deployed Outside Chinese Mainland feature.
Long Pending state for image building tasks
Problem description
The Image Builder feature of both Container Registry Personal Edition and Container Registry Enterprise Edition imposes a limit on the number of concurrent tasks for a single user.
Solutions
If the issue is caused by excessive image building tasks, use the following methods:
- If you use a Container Registry Personal Edition instance, upgrade your instance to Container Registry Enterprise Edition.
- If you use a Container Registry Enterprise Edition instance, apply for an increased quota of image building tasks.
Failure in the process of building images
The causes of errors that occur in the building process are complex. If resource pulling times out, you can use the following method to resolve the issue:
Accelerate image pulling. For more information, see Slow image building.