Migrating Images to SWR Using Docker Commands
Scenarios
SWR provides easy-to-use image hosting and efficient distribution services. If a small quantity of images need to be migrated, enterprises can use the docker pull/push command to migrate images to SWR.
Procedure
- Pull images from the source repository.
Run the docker pull command to pull the images.
Example: docker pull nginx:latest
Run the docker images command to check whether the images are successfully pulled.# docker images REPOSITORY TAG IMAGE ID CREATED SIZE nginx latest 22f2bf2e2b4f 5 hours ago 22.8MB
- Push the images pulled in 1 to SWR.
- Log in to the VM where the destination container is located and log in to SWR.
- Tag the images.
docker tag [Image name:Tag name] [Image repository address]/[Organization name]/[Image name:Tag name]
- Run the following command to push the images to the destination image repository.
docker push [image-repository-address]/[organization-name]/[image-name:tag-name]
- Check whether the following information is returned. If yes, the push is successful.
fbce26647e70: Pushed fb04ab8effa8: Pushed 8f736d52032f: Pushed 009f1d338b57: Pushed 678bbd796838: Pushed d1279c519351: Pushed f68ef921efae: Pushed v1: digest: sha256:0cdfc7910db531bfa7726de4c19ec556bc9190aad9bd3de93787e8bce3385f8d size: 1780
To view the pushed image, refresh the My Images page.