For security reasons, Gold Zone image repositories cannot be accessed from the public network. To upload an image, you must use an Elastic Compute Service (ECS) server that is in the same Virtual Private Cloud (VPC). This topic describes how to upload an image from an ECS server to a Gold Zone image repository.
Prerequisites
The image building process is complete.
You have created a Gold Zone image repository.
You have installed Docker.
NoteYou must install Docker locally to run commands that package the image into a compressed file. For installation instructions, see the official Docker website.
Procedure
Package the local image into a compressed file.
On your local machine, run the following command to view information about your local images:
sudo docker imagesThe following output is an example of the returned image information:
sudo docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE registry.aliyuncs.com/acs/agent 0.7-dfb6816 37bb9c****** 7 days ago 37.89 MBPackage the local image into a compressed file.
sudo docker save -o [package_name] [REPOSITORY]:[TAG]The following are examples of variable values:
Variable name
Description
Example value
[package_name]
The name of the compressed package.
sofaboot_demo.tar.gz
[REPOSITORY]
The repository address.
registry.aliyuncs.com/acs/agent
[TAG]
The version number.
1.0.0
Upload the compressed package to the ECS server.
On your local machine, run the following command to upload the compressed package to the ECS server:
sudo scp [package_name] root@[ECS_public_IP]:[path_on_ECS_server]Examples of variable values include the following:
Variable
Example value
[path_on_ECS_server]
/home/images/
[package_name]
sofaboot_demo.tar.gz
[ECS_public_IP]
121.41.***.***
Upload the image to the image repository.
Log on to the Container Application Service console. In the navigation pane on the left, click Cluster Management > Cluster Details.
On the Cluster Details page, click the Nodes tab.
Find the target node and click Remote Connection in the Actions column.
ImportantThe ECS server must be assigned an elastic IP address (EIP). For more information, see Apply for a new EIP.
Enter the VNC password.
NoteIf you forget the VNC password, you can click Modify VNC Password to reset it.
Enter the ECS server password.
Run the following commands to upload the image to the image repository:
sudo cd [path_on_ECS_server] sudo docker load -i [package_name] sudo docker login --username=[logon_account] [Registry] sudo docker tag [ImageId] [repository_address]:[image_version_number] sudo docker push [repository_address]:[image_version_number]The following are example variable values:
Variable
Example value
[path_on_ECS_server]
/home/images/
[package_name]
sofaboot_demo.tar.gz
[logon_account]
aksinpsecttest@1639881487******
[Registry]
registry-vpc.cn-hangzhou-finance.aliyuncs.com
[ImageId]
798f63******
[repository_address]
registry-vpc.cn-hangzhou-finance.aliyuncs.com/sofaboot-space/sofaboot_store
[image_version_number]
1.0.0