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

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

    You will need to save the Docker image as a tar file:

    docker save -o  
    

    Then copy your image to a new system with regular file transfer tools such as cp, scp or rsync(preferred for big files). After that you will have to load the image into Docker:

    docker load -i 
    

    PS: You may need to sudo all commands.

    EDIT: You should add filename (not just directory) with -o, for example:

    docker save -o c:/myfile.tar centos:16
    

提交回复
热议问题