How to copy Docker images from one host to another without using a repository

前端 未结 15 1731
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 13:37

How do I transfer a Docker image from one machine to another one without using a repository, no matter private or public?

I create my own image in VirtualBox, and wh

15条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 13:58

    To save an image to any file path or shared NFS place see the following example.

    Get the image id by doing:

    sudo docker images
    

    Say you have an image with id "matrix-data".

    Save the image with id:

    sudo docker save -o /home/matrix/matrix-data.tar matrix-data
    

    Copy the image from the path to any host. Now import to your local Docker installation using:

    sudo docker load -i 
    

提交回复
热议问题