Docker Import Export mirror

Source: Internet
Author: User
Tags docker hub
import mirrors from the local file system

Tar format mirrored package download address: http://openvz.org/Download/templates/precreated

For example, first download a ubuntu-14.04 mirror, and then use the following command to import:

# cat ubuntu-14.04-x86_64-minimal.tar.gz |docker import-ubuntu:14.04

Then view the newly imported mirrors

# Docker Images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu 14.04 05ac7c0b9383-seconds ago 215.5 MB
Uploading Mirrors

Users can share the images they create by uploading them to the warehouse via the Docker push command. For example, after the user has completed registering on the Docker Hub, you can push your mirror to the warehouse.

# Docker Push Ouruser/sinatra The
push refers to a repository [Ouruser/sinatra] (len:1)
sending image list
Pu Shing Repository Ouruser/sinatra (3 tags)
Save and load mirror like To save a mirror

If you want to export mirrors to local files, you can use the Docker Save command

# sudo docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu 14.04 c4ff7513909d 5 weeks ago 225.4 mb
   ... # sudo docker save-o Ubuntu_14.04.tar ubuntu:14.04
Load Mirror like

You can use Docker load to import from the exported local file to the local mirror library, for example

# sudo docker load--input ubuntu_14.04.tar
or
# sudo docker load < Ubuntu_14.04.tar

This will import the mirror and its associated metadata information (including tags, etc.) to remove the local mirror

If you want to remove a local mirror, you can use the Docker RMI command. Note The Docker RM command is the removal container

# sudo docker rmi Training/sinatra
untagged:training/sinatra:latest
Deleted: 5bc342fa0b91cabf65246837015197eecfa24b2213ed6a51a8974ae250fedd8d
Deleted: ed0fffdcdae5eb2c3a55549857a8be7fc8bc4241fb19ad714364cbfd7a56b22f
Deleted: 5c58979d73ae448df5af1d8142436d81116187a7633082650549c52c3a2418f0

Note: Use Docker rm to delete all containers that depend on this mirror before removing the mirror.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.