我有一个QuestDB容器,目前正在运行一个旧版本,它由--name
启动和停止,以便数据持久化:
docker run --name old_questdb
-p 9000:9000 -p 9009:9009 questdb/questdb:5.0.5.4-linux-amd64
是否有办法将卷挂载或将此命名容器中的持久化数据获取到具有最新版本的新实例中?我想运行6.0.4
您可以将容器的内容复制到本地目录,然后将其挂载回新目录:
# copy the contents of the old_questdb container to the current dir
docker cp old_questdb:/root/.questdb $(pwd)
# run 6.0.4 and mount to the current dir
docker run --name new_questdb
-v "$(pwd)/.questdb:/root/.questdb/"
-p 9000:9000 -p 9009:9009 questdb/questdb:6.0.4