docker部署的openlist的更新和迁移教程
更新:
1.拉取新镜像,停止并删除旧容器,创建新容器:
docker pull openlistteam/openlist:latest
docker stop openlist
docker rm openlist
docker run --user $(id -u):$(id -g) -d --restart=unless-stopped -v /etc/openlist:/opt/openlist/data -p 127.0.0.1:5244:5244 -e UMASK=022 --name="openlist" openlistteam/openlist:latest
2.清理旧镜像: 参照Windows电脑安装Docker Desktop并构建、运行、打包NotionNext镜像全过程
迁移:
1.旧 VPS 暂时停止openlist,打包 Docker 的Openlist环境到root,手动下载压缩包:
docker stop openlist
tar -czvf /root/openlist-data.tar.gz -C /etc/openlist .
docker restart openlist
2.上传压缩包到/root,创建目标目录,然后将压缩包从 /root 解压到目标目录:
mkdir -p /etc/openlist
tar -xzvf openlist-data.tar.gz -C /etc/openlist
3.启动 Docker 容器:
docker run --user $(id -u):$(id -g) -d --restart=unless-stopped -v /etc/openlist:/opt/openlist/data -p 127.0.0.1:5244:5244 -e UMASK=022 --name="openlist" openlistteam/openlist:latest
4.删除多余的压缩包:
rm -f /root/openlist-data.tar.gz