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

前端 未结 15 1729
爱一瞬间的悲伤
爱一瞬间的悲伤 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 14:11

    Run

    docker images
    

    to see a list of the images on the host. Let's say you have an image called awesomesauce. In your terminal, cd to the directory where you want to export the image to. Now run:

    docker save awesomesauce:latest > awesomesauce.tar
    

    Copy the tar file to a thumb drive or whatever, and then copy it to the new host computer.

    Now from the new host do:

    docker load < awesomesauce.tar
    

    Now go have a coffee and read Hacker News...

提交回复
热议问题