SoftWare Repository for Container
SoftWare Repository for Container
- What's New
- Function Overview
- Service Overview
- Getting Started
-
User Guide
- Overview
- Permissions Management
- Basics of Docker
-
Image Management
- Pushing an Image Through a Container Engine Client
- Obtaining a Long-Term Valid Docker Login Command
- Obtaining a Long-Term Valid containerd Pull/Push Command
- Uploading an Image Through the SWR Console
- Pulling an Image
- Setting Image Attributes
- Sharing Private Images
- Adding a Trigger
- Adding an Image Retention Policy
- Image Center
- Organization Management
- User Permissions
- Auditing
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
API
- Organization Management
- Image Repository Management
- Image Tag Management
- Shared Account Management
- API Versions
- Organization Permission Management
- Image Permission Management
- Automatic Image Synchronization Task Management
- Trigger Management
- Image Retention Policy Management
- Temporary Login Command
- Quota Management
- Example Applications
- Appendixes
- Change History
- FAQs
- Videos
- SDK Reference
On this page
Pulling an Image
Updated on 2024-11-08 GMT+08:00
Scenario
You can use Docker or containerd to pull images from SWR.
Prerequisites
- Before pulling an image, ensure that your network connection is normal.
- Before pulling an image, contact the administrator to grant the SWR pull permission on the IAM console. For details, see SWR Permissions.
- On the My Images page, Private Images list your own images in your organization and Shared Images list private images shared by other users in the organization.
- After an IAM user is created, the administrator needs to grant permissions to the user in the organization so that the user can read and edit images in the organization. For details, see User Permissions.
Docker
- Log in to the VM running Docker as the root user.
- Obtain a login command by referring to Step 1 and access SWR.
- Log in to the SWR console.
- In the navigation pane, choose My Images and click the target image.
- On the Image Tags tab page, in the same row as the target image tag, click
in the Image Pull Command column to copy the command.
- Run the image pull command obtained in Step 5 on the VM.
Run the docker images command to check whether the images are successfully pulled.
# docker images REPOSITORY TAG IMAGE ID CREATED SIZE xxx/group/nginx v2.0.0 22f2bf2e2b4f 5 hours ago 22.8MB
- (Optional) Run the following command to save the image as an archive file:
docker save [Image name:tag name] > [Archive file name]
containerd
- Log in to the SWR console.
- In the navigation pane, choose My Images and click the name of your image.
- On the Tags tab page, click containerd command in the Operation column to copy the image pull command. Alternatively, go to the Pull/Push tab page to copy the image pull command.
NOTE:
The command is only valid for six hours after it is generated. To obtain a long-term valid command, see Obtaining a Long-Term Valid containerd Pull/Push Command.
- Log in to the VM running containerd as the root user.
- Run the command copied in Step 3.
- If the command was copied from the Operation column, run it as follows.
- If the command was copied from the Pull/Push tab page, run it as follows (replace {Tag} with the new image tag).
- If the command was copied from the Operation column, run it as follows.
- Check whether the image is pulled successfully.
- If the command was copied from the Operation column, run crictl images to check whether the pull is successful.
- If the command was copied from the Pull/Push tab page, run ctr images list to check whether the pull is successful.
- If the command was copied from the Operation column, run crictl images to check whether the pull is successful.
Parent topic: Image Management
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.