docker backup & restore

当前任务

https://docs.docker.com/desktop/backup-and-restore/

https://docs.docker.com/engine/reference/commandline/commit/

https://registry.intbird.net/v2/

两年前的docker仓库怕不够用,给换了个100G的机器,有空就push一下

随着机器的运行时长,垃圾增长和配置臃肿,想着机器迁移一下

直接把container备份出来得了,其他都删了吧

//创建备份
docker container commit \
--change "ENV DEBUG=true" \
discourse registry.intbird.net/discourse

//创建备份
docker container commit \
--change "ENV DEBUG=true" \
apache-php  registry.intbird.net/web/apache-php

//上传备份
docker push registry.intbird.net/discourse

//查看备份
docker inspect -f "{{ .Config.Env }}" registry.intbird.net/discourse

//拉取备份
docker pull registry.intbird.net/discourse

//拉取数据
rsync -ahivzPL --delete --progress \
-e "ssh -i $/id_rsa" \
root@$.intbird.$:$/discourse/  $/discourse

//恢复备份
docker run -d \
--name discourse \
-v /var/discourse/shared/standalone:/shared \
-v /var/discourse/shared/standalone/certs:/sock \
-v /var/discourse/shared/standalone/log/var-log:/var/log \
registry.intbird.net/discourse:latest

历史笔记

https://intbird.atlassian.net/wiki/spaces/~644199061/pages/205422593/docker-installer

要不是之前这些笔记,都快忘了怎么搞的了

仓库浏览

https://github.com/klausmeyer/docker-registry-browser

仓库管理

portus:

https://github.com/SUSE/Portus

protainer-io:

manul:

/var/lib/registry/docker/registry/v2/repositories

mv