1
Docker容器云服务器迁移备忘录
source link: https://blog.52itstyle.vip/archives/5556/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Docker容器云服务器迁移备忘录
腾讯云服务器到期了,续费是真鸡儿贵,基于网站也没啥流量,就索性买了腾讯云的轻量应用服务器。
记得初始化轻量应用服务器,建议选择自带 Docker
容器的镜像。
# 查看运行中的容器
docker ps
# 打包镜像
docker commit <容器ID> <命名>
查看镜像,主要是查找镜像ID,用于tag
docker images
# 标记本地镜像
docker tag <镜像ID> registry.cn-hangzhou.aliyuncs.com/itstyle/mindoce:2.0
# 登录远程仓库
docker login --username=3458****@qq.com registry.cn-hangzhou.aliyuncs.com
# 推送到远程
docker push registry.cn-hangzhou.aliyuncs.com/itstyle/mindoce:2.0
docker run --name=mindoc --restart=always -v /data/mindoc/uploads:/mindoc/uploads -v /data/mindoc/database:/data/database -p 8181:8181 <镜像ID>
# 打包
tar -czvf mindoc.tar mindoc/
# 远程下载附件
scp [email protected]:/data/mindoc.tar /data
# 解压
tar -xvf mindoc.tar
作者: 小柒
出处: https://blog.52itstyle.vip
分享是快乐的,也见证了个人成长历程,文章大多都是工作经验总结以及平时学习积累,基于自身认知不足之处在所难免,也请大家指正,共同进步。
本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出, 如有问题, 可邮件([email protected])咨询。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK