How to backup/restore docker image for deployment?

后端 未结 2 1755
青春惊慌失措
青春惊慌失措 2021-01-30 05:19

I have an image to be updated with following command before each deployment.

$docker pull myusername/myproject:latest

This command overwrites t

2条回答
  •  佛祖请我去吃肉
    2021-01-30 06:16

    How can I backup this image

    Simply use the docker save command. $ docker save myusername/myproject:latest | gzip -c > myproject_img_bak20141103.tgz

    You will later be able to restore it with the docker load command. gunzip -c myproject_img_bak20141103.tgz | docker load


    or change it to a different tag locally without committing to networking repository?

    Use the docker tag command: $ docker tag myusername/myproject:latest myusername/myproject:bak20141103

提交回复
热议问题