Download foreign images using Alibaba Cloud Image Repository In the daily use of Docker or K8S, you often need to download images from foreign websites, but some websites are not accessible in China. To solve this problem, you can use the image repository provided by Alibaba Cloud to download it, then pull it to your local computer and modify the tag to implement it. For example, when deploying Istio using K8S, you need to download the gcr.io/istio-testing/install-cni:1.5-dev image. You can build and download it in Alibaba Cloud according to the following steps: 1. Configure Github First log in to Github and create a repository for building images, for example, named image-build Create a folder on your local computer, for example, named dockerImage Enter the dockerImage directory and clone the repository in Github to your local machine. After cloning is complete, enter the image-build directory and create a Dockerfile named install-cni with the following content: FROM gcr.io/istio-testing/install-cni:1.5-dev Submit the Dockerfile file you just created to git and specify the branch name as master (modify it according to the default first branch name when creating a repository in Github) git add install-cni git commit -m "Create Dockerfile to build install-cni image" git branch -M master Push the content in git to Github: git push -u origin master 2. Configure Alibaba Cloud The steps to configure the image repository and build in Alibaba Cloud are as follows: Log in to the Alibaba Cloud console and enter the container image service Click on After the binding is completed, click the image repository in the left tab to start creating the namespace, repository name and summary information, and click Next Select Github in the code source, CoderX-Aaron (that is, the username of Github) in the namespace, and image-build in the repository. In the build settings below, check After creating the repository, click Manage Repository and select Build in the left tab. First, set up a new build rule in the build rules. Pay attention to the path and file name of the Dockerfile directory, which should be consistent with that in Github. After creating the build rule, click the "Build Now" button behind the corresponding rule to start building the image. 3. Pull the image After the image is built successfully, you can see the built image in the "Image Version" tab. Next, pull the image to the local computer. The steps are as follows: First, log in to the Alibaba Cloud Mirror Repository in the command line of the local machine. The username used for login is the full name of the Alibaba Cloud account, and the password is the password set when activating the service. docker login --username=username registry.cn-hangzhou.aliyuncs.com Pull the image from the registry to the local docker pull registry.cn-hangzhou.aliyuncs.com/ops-docker/istio:v1 Modify the image tag docker tag registry.cn-hangzhou.aliyuncs.com/ops-docker/istio:v1 gcr.io/istio-testing/install-cni:1.5-dev This completes the download of the install-cni image and changes the image pull policy in K8S to 4. Push the image to Alibaba Cloud To push a local image to Alibaba Cloud, you first need to modify the tag of the local image: docker tag [ImageId] registry.cn-hangzhou.aliyuncs.com/ops-docker/istio:[image version number] Next, push the image: docker push registry.cn-hangzhou.aliyuncs.com/ops-docker/istio:[image version number] This concludes this article on how to use Alibaba Cloud's image repository to build foreign Docker images. For more information about how to build foreign Docker images on Alibaba Cloud, please search for previous articles on 123WORDPRESS.COM or continue browsing the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of explain type in MySQL
>>: Install nodejs and yarn and configure Taobao source process record
Variables defined in SASS, the value set later wi...
During the configuration of Jenkins+Tomcat server...
type is the control used for input and output in t...
Problem: The overflow of the auto-increment ID in...
Detailed explanation of JDBC database link and re...
Type yum install mysql-server Press Y to continue...
Table of contents Install Docker on CentOS 8 1. U...
Basic Concepts By default, Compose creates a netw...
<div id="root"> <h2>Keep go...
XMeter API provides a one-stop online interface t...
Pure front-end implementation:切片上傳斷點續傳.斷點續傳needs ...
As one of the most commonly used and important ut...
There are many tags and elements in the HTML head ...
This article uses examples to illustrate the prin...
1. Clustered Index Table data is stored in the or...